查看“︁司徒頓t檢定”︁的源代码
←
司徒頓t檢定
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{noteTA |G1 = Math |T = zh-hans:学生t检验;zh-hant:司徒頓t檢定; zh-tw:司徒頓t檢定 ;zh-hk:學生t檢驗 |1 = zh:學生;zh-cn:学生;zh-tw:司徒頓 |2= zh-cn:齐性; zh-tw:同質性; |3=zh-tw:高斯特;zh-cn:戈塞;zh-hk:戈塞; }} '''司徒頓''t'' 檢定'''({{lang-en|Student's ''t''-test}})是指[[虛無假說]]成立時的任一檢定統計有[[司徒頓t分布]]的[[統計假說檢定]],屬於[[母數統計]]。學生''t''檢驗常作為檢驗一群來自[[常態分配]][[母體]]的獨立[[樣本 (統計學)|樣本]]之[[期望值]]是否為某一實數,或是二(两)群來自[[常態分配]][[母體]]的獨立[[樣本 (統計學)|樣本]]之[[期望值]]的差是否為某一實數。舉個簡單的例子,在某個學校中我們可以從某個年級中隨機抽樣一群男生,以檢驗該年級男生與全校男生之身高差異程度是否如我們所假設的某個值。 == 由來 == 司徒頓''t''檢定是[[威廉·戈塞]]為了觀測釀酒品質於1908年所提出的,「司徒頓 (student)」則是他的[[筆名]]。<ref>Richard Mankiewicz, ''The Story of Mathematics'' (Princeton University Press), p.158.</ref><ref name="Gossett">{{MacTutor Biography|id=Gosset}}</ref><ref>{{cite journal | last=Fisher Box | first=Joan | journal=Statistical Science | year=1987 | pages=45–52 | volume=2 | jstor=2245613 | title=Guinness, Gosset, Fisher, and Small Samples | url=https://archive.org/details/sim_statistical-science_1987-02_2_1/page/45 | doi=10.1214/ss/1177013437 | issue=1 }}</ref><ref>{{Cite web |url=http://www.aliquote.org/cours/2012_biomed/biblio/Student1908.pdf |title=存档副本 |access-date=2013-08-10 |archive-url=https://web.archive.org/web/20170516164344/http://www.aliquote.org/cours/2012_biomed/biblio/Student1908.pdf |archive-date=2017-05-16 |dead-url=yes }}</ref> 基於克勞德·健力士(Claude Guinness)聘用從[[牛津大學]]和[[劍橋大學]]出來的最好的畢業生,<ref name="Gossett" />以將生物化學及統計學應用到[[健力士]]工業流程的創新政策,[[威廉·戈塞|戈塞]]受雇於[[都柏林]]的健力士釀酒廠擔任統計學家。[[威廉·戈塞|戈塞]]提出了''t''检验以降低啤酒重量监控的成本。[[威廉·戈塞|戈塞]]於1908年在《{{Link-en|Biometrika|Biometrika}}》期刊上公布t檢驗,但因其老闆認為其為商業機密而被迫使用筆名,統計學論文內容也跟釀酒無關。實際上,其他统计学家是知道[[威廉·戈塞|戈塞]]真實身份的。 == 應用 == 常見的應用有: * 单样本检验:检验一个[[正态分布]]的总体的均值是否在满足零假设的值之内,例如檢驗一群軍校男生的身高的平均是否符合全國標準的170公分界線。 * 獨立樣本t檢定(双样本):其[[零假设]]为两个正态分布的总体的均值之差為某實數,例如檢定二群人之平均身高是否相等。若两母體的[[變異數]]是相等的情况下(同質變異數),自由度為兩樣本數相加再減二;若為異質變異數(母體變異數不相等),自由度則為Welch自由度,此情況下有时被称为Welch检验。 * 配对樣本t檢定(成對樣本t檢定):檢定自同一母體抽出的成對樣本間差异是否为零。例如,檢测一位病人接受治疗前和治疗后的肿瘤尺寸大小。若治疗是有效的,我们可以推定多数病人接受治疗后,肿瘤尺寸將縮小。 * 检验一[[迴歸]]模型的偏迴歸係數是否显著不为零,即檢定解釋變數X是否存在對被解釋變數Y的解釋能力,其檢定統計量稱之為t-比例(t-ratio)。 ==前提假設== 大多數的''t''檢定之統計量具有''t'' = ''Z''/''s''的形式,其中''Z''與''s''是已知資料的函數。''Z''通常被設計成對於[[對立假說]]有關的形式,而''s''是一個比例母數使''t''服從於''t''分佈。以單樣本''t''檢驗為例,<math>Z = \bar{X}/(\sigma/\sqrt{n})</math>,其中<math>\bar{X}</math>為樣本平均數,<math>n</math>為樣本數,<math>\sigma</math>為总体[[標準差]]。至於''s''在單樣本''t''檢驗中為<math>\hat{\sigma}/\sigma</math>,其中<math>\hat{\sigma}</math>為樣本的標準差。在符合零假說的條件下,''t''檢定有以下前提: * ''Z'' 服從標準常態分佈 * (''n'' - 1)''s''<sup>2</sup> 服從自由度(''n'' - 1)的卡方分佈 * ''Z''與''s''互相獨立 ==計算== ===單樣本''t''檢驗=== 檢驗虛無假說為一群來自常態分配獨立樣本''x''<sub>''i''</sub>之母體期望值''μ''為''μ''<sub>0</sub>可利用以下統計量 :<math> t = \frac{\overline{x} - \mu_0}{s/\sqrt{n}} </math> 其中<math>i = 1 \ldots n</math>,<math>\overline{x} = \frac{\sum_{i=1}^{n} x_i}{n}</math>為樣本平均數,<math>s = \sqrt{\frac{\sum_{i=1}^{n}(x_i-\overline{x})^2}{n-1}} </math>為樣本[[標準差]],''n''為[[樣本數]]。該統計量''t''在虛無假說:''μ'' = ''μ''<sub>0</sub>為真的條件下服從自由度為''n'' − 1的[[t分佈]]。 ===配對樣本''t''檢驗=== 配對樣本''t''檢驗可視為單樣本''t''檢驗的擴展,不過檢驗的對象由一群來自常態分配獨立樣本更改為兩配對樣本之觀測值之差。 若兩配對樣本''x''<sub>1''i''</sub>與''x''<sub>2''i''</sub>之差為''d''<sub>''i''</sub> = ''x''<sub>1''i''</sub> − ''x''<sub>2''i''</sub>獨立且來自常態分配,則''d''<sub>''i''</sub>之母體期望值''μ''是否為''μ''<sub>0</sub>可利用以下統計量 :<math> t = \frac{\overline{d} - \mu_0}{s_d/\sqrt{n}} </math> 其中<math>i = 1 \ldots n</math>,<math>\overline{d} = \frac{\sum_{i=1}^{n} d_i}{n}</math>為配對樣本差值之平均數,<math>s_d = \sqrt{\frac{\sum_{i=1}^{n}(d_i-\overline{d})^2}{n-1}} </math>為配對樣本差值之[[標準差]],''n''為配對[[樣本數]]。該統計量''t''在虛無假說:''μ'' = ''μ''<sub>0</sub>為真的條件下服從自由度為''n'' − 1的[[t分布]]。 ===獨立雙樣本''t''檢驗=== ====同質變異數假設 (Homoscedasticity)、樣本數相等==== 若兩獨立樣本''x''<sub>1''i''</sub>與''x''<sub>2''i''</sub>具有相同之樣本數''n'',且來自兩個母體變異數相同(同質變異數假設)的常態分配,則兩母體之期望值差''μ''<sub>1</sub> - ''μ''<sub>2</sub>是否為''μ''<sub>0</sub>可利用以下統計量 :<math> t = \frac{\overline{x}_1 - \overline{x}_2 - \mu_0}{\sqrt{ 2s_p^2 / n}} </math> 其中<math>i = 1 \ldots n</math>,<math>\overline{x}_1 = (\sum_{i=1}^n x_{1i}) / n</math>及<math>\overline{x}_2 = (\sum_{i=1}^n x_{2i}) / n</math>為兩樣本各自的平均數,<math>s^2_p = ( \sum_{i=1}^n (x_{1i}-\overline{x}_1)^2 + \sum_{i=1}^n (x_{2i}-\overline{x}_2)^2 ) / (2n-2) </math>為樣本之共同[[方差]]。該統計量''t''在虛無假說:''μ''<sub>1</sub> - ''μ''<sub>2</sub> = ''μ''<sub>0</sub>為真的條件下服從自由度為2''n'' − 2的[[t分佈]]。 ====同質變異數假設 (Homoscedasticity)、樣本數不相等==== 若兩獨立樣本''x''<sub>1''i''</sub>與''x''<sub>2''j''</sub>具有不相同之樣本數''n''<sub>1</sub>與''n''<sub>2</sub>,且來自兩個母體變異數相同(同質變異數假設)的常態分配,則兩母體之期望值之差''μ''<sub>1</sub> - ''μ''<sub>2</sub>是否為''μ''<sub>0</sub>可利用以下統計量 :<math> t = \frac{\overline{x}_1 - \overline{x}_2 - \mu_0}{\sqrt{ s_p^2 / n_1 + s_p^2 / n_2}} </math> 其中<math>i = 1 \ldots n_1</math>,其中<math>j = 1 \ldots n_2</math>,<math>\overline{x}_1 = (\sum_{i=1}^n x_{1i}) / n</math>及<math>\overline{x}_2 = (\sum_{i=1}^n x_{2i}) / n</math>為兩樣本各自的平均數,<math>s^2_p = ( \sum_{i=1}^n (x_{1i}-\overline{x}_1)^2 + \sum_{j=1}^n (x_{2j}-\overline{x}_2)^2 ) / (n_1 + n_2 - 2) </math>為兩樣本共同之[[方差]]。該統計量''t''在虛無假說:''μ''<sub>1</sub> - ''μ''<sub>2</sub> = ''μ''<sub>0</sub>為真的條件下服從自由度為''n''<sub>1</sub> + ''n''<sub>2</sub> − 2的[[t分佈]]。 ==== 異質變異數假設 (Heteroscedasticity)==== 若兩獨立樣本''x''<sub>1''i''</sub>與''x''<sub>2''j''</sub>具有相同或不相同之樣本數''n''<sub>1</sub>與''n''<sub>2</sub>,且兩者母體變異數不相等(異質變異數假設)的常態分配,則兩母體之期望值之差''μ''<sub>1</sub> - ''μ''<sub>2</sub>是否為''μ''<sub>0</sub>可利用以下統計量 :<math> t = \frac{\overline{x}_1 - \overline{x}_2 - \mu_0}{\sqrt{ s_1^2 / n_1 + s_2^2 / n_2}} </math> 其中<math>i = 1 \ldots n_1</math>,其中<math>j = 1 \ldots n_2</math>,<math>\overline{x}_1 = (\sum_{i=1}^{n_1} x_{1i}) / n_1</math>及<math>\overline{x}_2 = (\sum_{j=1}^{n_2} x_{2j}) / n</math>為兩樣本各自的平均數,<math>s^2_1 = (\sum_{i=1}^n (x_{1i}-\overline{x}_1)^2)/(n_1 - 1)</math>及<math>s^2_2 = (\sum_{j=1}^n (x_{2j}-\overline{x}_2)^2)/(n_2 - 1)</math>分別為兩樣本之[[方差]]。該統計量''t''在虛無假說:''μ''<sub>1</sub> - ''μ''<sub>2</sub> = ''μ''<sub>0</sub>為真的條件下服從自由度為 :<math> df = \frac{ (s_1^2/n_1 + s_2^2/n_2)^2 }{ (s_1^2/n_1)^2/(n_1-1) + (s_2^2/n_2)^2/(n_2-1) } </math> 之[[t分布]]。這種方法又常稱為Welch檢驗。 ===其它相關檢驗=== ====偏迴歸係數是否為零之檢定==== =====以簡單線性迴歸為例===== {{main|線性回歸#單變數線性迴歸}} 模型假設: : <math> y_i = \alpha + \beta x_i + \varepsilon_i, </math> 其中''x''<sub>''i''</sub>,''i'' = 1, ..., ''n''為已知,''α''與''β''為未知係數,''ε''<sub>''i''</sub>為[[殘差]]獨立且服從期望值0且方差''σ''<sup>2</sup>未知的常態分佈,''y''<sub>''i''</sub>,''i'' = 1, ..., ''n''為觀測值。我們可以檢驗迴歸係數''β''是否相等於特定的''β''<sub>0</sub>,通常使''β''<sub>0</sub> = 0以檢定''x''<sub>''i''</sub>對''y''<sub>''i''</sub>是否存在解釋能力,在此例(簡單線性迴歸模型)即為檢定迴歸式之斜率是否為零。 令<math>\widehat\alpha</math>與<math>\widehat\beta</math>為[[最小平方法]]之估計值,<math>SE_{\widehat\alpha}</math>與<math>SE_{\widehat\beta}</math>為最小平方法估計值之標準誤差,則 : <math> t = \frac{\widehat\beta - \beta_0}{ SE_{\widehat\beta} }\sim\mathcal{T}_{n-2} </math> 在虛無假說為β = β<sub>0</sub>的情況下服從自由度為''n'' − 2之t分布,此檢定統計量被稱作「'''t比率 (t-ratio)'''」,其中 : <math> SE_{\widehat\beta} = \frac{\sqrt{\frac{1}{n - 2}\sum_{i=1}^n (y_i - \widehat y_i)^2}}{\sqrt{ \sum_{i=1}^n (x_i - \overline{x})^2 }} </math> 由於 <math> \widehat\varepsilon_i = y_i - \widehat y_i = y_i - (\widehat\alpha + \widehat\beta x_i) </math>為殘差(即估計誤差),而 <math> \text{SSR} = \sum_{i=1}^n \widehat\varepsilon_i^{\;2} </math> 為殘差之離均平方和,我們可改寫''t''為 : <math> t = \frac{(\widehat\beta - \beta_0)\sqrt{n-2}}{ \sqrt{\text{SSR}/\sum_{i=1}^n \left(x_i - \overline{x}\right)^2} }</math> 另请参阅:[[F检验]] ==電腦軟體== 大多數的[[電子試算表|試算表]]軟體及統計軟體,諸如[[QtiPlot]]、[[OpenOffice.org Calc]]、[[LibreOffice Calc]]、[[Microsoft Excel]]、[[统计分析系统|SAS]]、[[SPSS]]、[[Stata]]、[[DAP (software)|DAP]]、[[gretl]]、[[R语言|R]]、[[Python]] ([http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_ind.html]{{Wayback|url=http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_ind.html |date=20131023060508 }})、[[PSPP]]、[[Minitab]]等,都可以進行''t''檢驗運算。 {| class="wikitable sortable" |- ! 编程语言/软件程序 !! 函数 !! 注释 |- | [[Microsoft Excel]] 2010 之前的版本 || <code>TTEST(''array1'', ''array2'', ''tails'', ''type'')</code> || 参见 [https://web.archive.org/web/20140321141801/http://office.microsoft.com/en-us/excel-help/ttest-HP005209325.aspx] |- | [[Microsoft Excel]] 2010 及更高版本 || <code>T.TEST(''array1'', ''array2'', ''tails'', ''type'')</code> || 参见 [http://office.microsoft.com/en-us/excel-help/t-test-function-HA102753135.aspx]{{Wayback|url=http://office.microsoft.com/en-us/excel-help/t-test-function-HA102753135.aspx |date=20140303022610 }} |- | [[LibreOffice]] || <code>TTEST(''Data1; Data2; Mode; Type'')</code> || 参见 [https://help.libreoffice.org/Calc/Statistical_Functions_Part_Five#TTEST]{{Wayback|url=https://help.libreoffice.org/Calc/Statistical_Functions_Part_Five#TTEST |date=20140228063256 }} |- | [[Google Sheets]] || <code>TTEST(range1, range2, tails, type)</code> || 参见 [https://support.google.com/docs/answer/6055837]{{Wayback|url=https://support.google.com/docs/answer/6055837 |date=20161221021654 }} |- | [[Python]] || <code>scipy.stats.ttest_ind(''a'', ''b'', ''axis=0'', ''equal_var=True'')</code> || 参见 [http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_ind.html]{{Wayback|url=http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_ind.html |date=20131023060508 }} |- | [[Matlab]] || <code>ttest(data1, data2)</code> || 参见 [http://www.mathworks.com/help/stats/ttest.html]{{Wayback|url=http://www.mathworks.com/help/stats/ttest.html |date=20170328110854 }} |- | [[Mathematica]] || <code>TTest[{data1,data2}]</code> || 参见 [http://reference.wolfram.com/language/ref/TTest.html]{{Wayback|url=http://reference.wolfram.com/language/ref/TTest.html |date=20161220121309 }} |- | [[R語言|R]] || <code>t.test(data1, data2)</code> || |- | [[統計分析系統|SAS]] || <code>PROC TTEST</code> || 参见 [https://web.archive.org/web/20131029195637/http://www.sas.com/offices/europe/belux/pdf/academic/ttest.pdf] |- | [[Java語言|Java]] || <code>tTest(sample1, sample2)</code> || 参见 [http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math4/stat/inference/TTest.html]{{Wayback|url=http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math4/stat/inference/TTest.html |date=20161104014648 }} |- | [[Julia語言|Julia]] || <code>EqualVarianceTTest(sample1, sample2)</code> || 参见 [https://web.archive.org/web/20160814024922/http://hypothesistestsjl.readthedocs.io/en/latest/parametric/test_t.html#EqualVarianceTTest] |- | [[Stata]] || <code>ttest data1 == data2</code> || See [https://www.stata.com/manuals13/rttest.pdf]{{Wayback|url=https://www.stata.com/manuals13/rttest.pdf |date=20161123045018 }} |} ==參見== *[[司徒頓t分布]] *[[F檢定]] *[[機率分布]] == 參考文獻 == {{Reflist|2}} {{-}} {{统计学}} [[Category:统计检验]]
该页面使用的模板:
Template:-
(
查看源代码
)
Template:Cite journal
(
查看源代码
)
Template:Cite web
(
查看源代码
)
Template:Lang-en
(
查看源代码
)
Template:Link-en
(
查看源代码
)
Template:MacTutor Biography
(
查看源代码
)
Template:Main
(
查看源代码
)
Template:NoteTA
(
查看源代码
)
Template:Reflist
(
查看源代码
)
Template:Wayback
(
查看源代码
)
Template:统计学
(
查看源代码
)
返回
司徒頓t檢定
。
导航菜单
个人工具
登录
命名空间
页面
讨论
不转换
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
工具
链入页面
相关更改
页面信息