Académique Documents
Professionnel Documents
Culture Documents
A t-test is any statistical hypothesis test in which the testStudents t-test work was submitted to and accepted in the
statistic follows a Students t-distribution under the null journal Biometrika and published in 1908.[5] Company
hypothesis. It can be used to determine if two sets of policy at Guinness forbade its chemists from publishing
data are signicantly dierent from each other. their ndings, so Gosset published his statistical work un-
der the pseudonym Student (see Students t-distribution
A t-test is most commonly applied when the test statistic
would follow a normal distribution if the value of a scaling for a detailed history of this pseudonym, which is not to
student).
term in the test statistic were known. When the scaling be confused with the literal term
term is unknown and is replaced by an estimate based Guinness had a policy of allowing technical sta leave
on the data, the test statistics (under certain conditions) for study (so-called study leave), which Gosset used
follow a Students t distribution. during the rst two terms of the 19061907 academic
year in Professor Karl Pearson's Biometric Laboratory at
University College London.[6] Gossets identity was then
1 History known to fellow statisticians and to editor-in-chief Karl
Pearson.[7]
It is not clear how much of the work Gosset performed
while he was at Guinness and how much was done when
he was on study leave at University College London.
2 Uses
Among the most frequently used t-tests are:
1
2 4 UNPAIRED AND PAIRED TWO-SAMPLE T-TESTS
A test of whether the slope of a regression line dif- Most two-sample t-tests are robust to all but large devia-
fers signicantly from 0. tions from the assumptions.[11]
3 Assumptions
4 Unpaired and paired two-sample
Most t-test statistics have the form t = Z/s, where Z and
s are functions of the data. Typically, Z is designed to be
t-tests
sensitive to the alternative hypothesis (i.e., its magnitude
tends to be larger when the alternative hypothesis is true),
whereas s is a scaling parameter that allows the distribu-
tion of t to be determined.
As an example, in the one-sample t-test t = Zs =
(X)/(/ n) is the sample mean from a sam-
s , where X
ple X1 ,X2 ,,Xn, of size n, s is the ratio of sample stan-
dard deviation over population standard deviation, is
the population standard deviation of the data, and is
the population mean.
The assumptions underlying a t-test are that
X1 X
2
bi = yi ybi = yi (b b i ) = residuals = errors estimated,
+ x t=
sp n11 + n12
n
SSR = bi = residuals of squares of sum.
2
i=1 where
Violations of these assumptions are discussed below. This test, also known as Welchs t-test, is used only when
The t statistic to test whether the means are dierent can the two population variances are not assumed to be equal
be calculated as follows: (the two sample sizes may or may not be equal) and
hence must be estimated separately. The t statistic to test
whether the population means are dierent is calculated
X1 X 2 as:
t=
sp 2/n
where X1 X2
t=
s
where
s2X1 + s2X2
sp =
2
Here sp is the pooled standard deviation for n=n1 =n2 and s21 s2
s = + 2.
s2X1 and s2X2 are the unbiased estimators of the variances n1 n2
6.1 Unequal variances 5
Here s2 is the unbiased estimator of the variance of each We will carry out tests of the null hypothesis that the
of the two samples with ni = number of participants in means of the populations from which the two samples
group i, i=1 or 2. Note that in this case s2 is not a pooled were taken are equal.
variance. For use in signicance testing, the distribution The dierence between the two sample means, each de-
of the test statistic is approximated as an ordinary Stu- noted by X i , which appears in the numerator for all the
dents t distribution with the degrees of freedom calcu- two-sample testing approaches discussed above, is
lated using
X 1 X 2 = 0.095.
(s21 /n1 + s22 /n2 )2
d.f. = .
(s21 /n1 )2 /(n1 1) + (s22 /n2 )2 /(n2 1) The sample standard deviations for the two samples are
approximately 0.05 and 0.11, respectively. For such small
This is known as the WelchSatterthwaite equation. The samples, a test of equality between the two population
true distribution of the test statistic actually depends variances would not be very powerful. Since the sample
(slightly) on the two unknown population variances (see sizes are equal, the two forms of the two-sample t-test
BehrensFisher problem). will perform similarly in this example.
For this equation, the dierences between all pairs must df 6.982.
be calculated. The pairs are either one persons pre-test
and post-test scores or between pairs of persons matched The test statistic is approximately 1.959, which gives a
into meaningful groups (for instance drawn from the same 2-tailed test p-value of 0.0956.
family or age group: see table). The average (XD) and
standard deviation (sD) of those dierences are used in
the equation. The constant 0 is non-zero if you want to
6.2 Equal variances
test whether the average of the dierence is signicantly
If the approach for equal variances (discussed above) is
dierent from 0 . The degree of freedom used is n 1,
followed, the results are
where n represents the number of pairs.
sp 0.084
6 Worked examples
and the degrees of freedom, df,
Let A1 denote a set obtained by drawing a random sample
of six measurements:
df = 10.
equal, variances. (The Welchs t-test is a nearly exact is preferable for hypothesis testing. Fishers Method for
test for the case where the data are normal but the vari- combining multiple tests with alpha reduced for positive
ances may dier.) For moderately large samples and a correlation among tests is one. Another is Hotellings T 2
one tailed test, the t is relatively robust to moderate vio- statistic follows a T 2 distribution. However, in practice
lations of the normality assumption.[15] the distribution is rarely used, since tabulated values for
2 2
For exactness, the t-test and Z-test require normality of T are hard to nd. Usually, T is converted instead to
the sample means, and the t-test additionally requires that an F statistic.
the sample variance follows a scaled 2 distribution, and For a one-sample multivariate test, the hypothesis is that
that the sample mean and sample variance be statistically the mean vector ( ) is equal to a given vector ( 0 ). The
independent. Normality of the individual data values is test statistic is Hotellings t 2 :
not required if these conditions are met. By the central
limit theorem, sample means of moderately large sam-
ples are often well-approximated by a normal distribution t2 = n(x 0 ) S1 (x 0 )
even if the data are not normally distributed. For non-
normal data, the distribution of the sample variance may where n is the sample size, x is the vector of column
deviate substantially from a 2 distribution. However, if means and S is a m m sample covariance matrix.
the sample size is large, Slutskys theorem implies that the
For a two-sample multivariate test, the hypothesis is that
distribution of the sample variance has little eect on the
the mean vectors ( 1 , 2 ) of two samples are equal.
distribution of the test statistic. If the data are substan-
The test statistic is Hotellings two-sample t 2 :
tially non-normal and the sample size is small, the t-test
can give misleading results. See Location test for Gaus-
sian scale mixture distributions for some theory related n1 n2
to one particular family of non-normal distributions. t2 = (x1 x2 ) Spooled 1 (x1 x2 ).
n +n
1 2
When the normality assumption does not hold, a non-
parametric alternative to the t-test can often have bet-
ter statistical power. For example, for two independent 9 Software implementations
samples when the data distributions are asymmetric (that
is, the distributions are skewed) or the distributions have Many spreadsheet programs and statistics packages, such
large tails, then the Wilcoxon rank-sum test (also known as QtiPlot, LibreOce Calc, Microsoft Excel, SAS,
as the MannWhitney U test) can have three to four times SPSS, Stata, DAP, gretl, R, Python, PSPP, Matlab and
higher power than the t-test.[15][16][17] The nonparametric Minitab, include implementations of Students t-test.
counterpart to the paired samples t-test is the Wilcoxon
signed-rank test for paired samples. For a discussion on
choosing between the t-test and nonparametric alterna- 10 See also
tives, see Sawilowsky (2005).[18]
One-way analysis of variance (ANOVA) generalizes the Conditional change model
two-sample t-test when the data belong to more than two
groups. F-test
Z-test
Main article: Hotellings T-squared distribution
MannWhitney U test
A generalization of Students t statistic, called Hotellings idk correction for t-test
t-squared statistic, allows for the testing of hypotheses
on multiple (often correlated) measures within the same Welchs t-test
sample. For instance, a researcher might submit a num-
ber of subjects to a personality test consisting of multiple Analysis of variance (ANOVA)
personality scales (e.g. the Minnesota Multiphasic Per-
sonality Inventory). Because measures of this type are
usually positively correlated, it is not advisable to con- 11 Notes
duct separate univariate t-tests to test hypotheses, as these
would neglect the covariance among measures and in- [1] Richard Mankiewicz (2004). The Story of Mathemat-
ate the chance of falsely rejecting at least one hypoth- ics (Paperback ed.). Princeton, NJ: Princeton University
esis (Type I error). In this case a single multivariate test Press. p. 158. ISBN 9780691120461.
7
[2] O'Connor, John J.; Robertson, Edmund F., William [17] Fay, Michael P.; Proschan, Michael A. (2010).
Sealy Gosset, MacTutor History of Mathematics archive, WilcoxonMannWhitney or t-test? On assumptions for
University of St Andrews. hypothesis tests and multiple interpretations of decision
rules. Statistics Surveys. 4: 139. doi:10.1214/09-
[3] Fisher Box, Joan (1987). Guinness, Gosset, Fisher, SS051. PMC 2857732 . PMID 20414472.
and Small Samples. Statistical Science. 2 (1): 4552.
doi:10.1214/ss/1177013437. JSTOR 2245613. [18] Sawilowsky, Shlomo S. (2005). Misconceptions Lead-
ing to Choosing the t Test Over The Wilcoxon Mann
[4] http://www.aliquote.org/cours/2012_biomed/biblio/ Whitney Test for Shift in Location Parameter. Journal
Student1908.pdf of Modern Applied Statistical Methods. 4 (2): 598600.
Retrieved 2014-06-18.
[5] The Probable Error of a Mean (PDF). Biometrika. 6
(1): 125. 1908. doi:10.1093/biomet/6.1.1. Retrieved
24 July 2016.
12 References
[6] Raju, T. N. (2005). William Sealy Gosset and William
A. Silverman: Two students of science. Pediatrics. O'Mahony, Michael (1986). Sensory Evaluation of
116 (3): 7325. doi:10.1542/peds.2005-1134. PMID Food: Statistical Methods and Procedures. CRC
16140715. Press. p. 487. ISBN 0-82477337-3.
[7] Dodge, Yadolah (2008). The Concise Encyclopedia of Press, William H.; Saul A. Teukolsky; William T.
Statistics. Springer Science & Business Media. pp. 234 Vetterling; Brian P. Flannery (1992). Numerical
5. ISBN 978-0-387-31742-7. Recipes in C: The Art of Scientic Computing.
Cambridge University Press. pp. p. 616. ISBN 0-
[8] Fadem, Barbara (2008). High-Yield Behavioral Sci- 521-43108-5. Archived from the original on 2015-
ence (High-Yield Series). Hagerstwon, MD: Lippincott
11-28.
Williams & Wilkins. ISBN 0-7817-8258-9.
[12] John A. Rice (2006), Mathematical Statistics and Data 14 External links
Analysis, Third Edition, Duxbury Advanced.
[13] David, H. A.; Gunnink, Jason L. (1997). The Paired t Hazewinkel, Michiel, ed. (2001), Student test,
Test Under Articial Pairing. The American Statistician. Encyclopedia of Mathematics, Springer, ISBN 978-
51 (1): 912. doi:10.2307/2684684. JSTOR 2684684. 1-55608-010-4
[14] George Box, William Hunter, and J. Stuart Hunter, Statis- A conceptual article on the Students t-test
tics for Experimenters, ISBN 978-0471093152, pp. 66
Econometrics lecture (topic: hypothesis testing) on
67.
YouTube by Mark Thoma
[15] Sawilowsky, Shlomo S.; Blair, R. Cliord (1992). A
More Realistic Look at the Robustness and Type II Error
Properties of the t Test to Departures From Population
Normality. Psychological Bulletin. 111 (2): 352360.
doi:10.1037/0033-2909.111.2.352.
15.2 Images
File:Ambox_important.svg Source: https://upload.wikimedia.org/wikipedia/commons/b/b4/Ambox_important.svg License: Public do-
main Contributors: Own work, based o of Image:Ambox scales.svg Original artist: Dsmurat (talk contribs)
File:Commons-logo.svg Source: https://upload.wikimedia.org/wikipedia/en/4/4a/Commons-logo.svg License: PD Contributors: ? Origi-
nal artist: ?
File:Fisher_iris_versicolor_sepalwidth.svg Source: https://upload.wikimedia.org/wikipedia/commons/4/40/Fisher_iris_versicolor_
sepalwidth.svg License: CC BY-SA 3.0 Contributors: en:Image:Fisher iris versicolor sepalwidth.png Original artist: en:User:Qwfp (origi-
nal); Pbroks13 (talk) (redraw)
File:Folder_Hexagonal_Icon.svg Source: https://upload.wikimedia.org/wikipedia/en/4/48/Folder_Hexagonal_Icon.svg License: Cc-by-
sa-3.0 Contributors: ? Original artist: ?
File:Lock-green.svg Source: https://upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg License: CC0 Contributors: en:File:
Free-to-read_lock_75.svg Original artist: User:Trappist the monk
File:People_icon.svg Source: https://upload.wikimedia.org/wikipedia/commons/3/37/People_icon.svg License: CC0 Contributors: Open-
Clipart Original artist: OpenClipart
File:Portal-puzzle.svg Source: https://upload.wikimedia.org/wikipedia/en/f/fd/Portal-puzzle.svg License: Public domain Contributors: ?
Original artist: ?
File:Power_of_t-tests.png Source: https://upload.wikimedia.org/wikipedia/commons/5/57/Power_of_t-tests.png License: CC BY 4.0
Contributors: Own work Original artist: Moritz Kohls
File:Type_1_error.png Source: https://upload.wikimedia.org/wikipedia/commons/c/c8/Type_1_error.png License: CC BY 4.0 Contrib-
utors: Own work Original artist: Moritz Kohls
File:Wikiversity-logo.svg Source: https://upload.wikimedia.org/wikipedia/commons/9/91/Wikiversity-logo.svg License: CC BY-SA 3.0
Contributors: Snorky (optimized and cleaned up by verdy_p) Original artist: Snorky (optimized and cleaned up by verdy_p)
File:William_Sealy_Gosset.jpg Source: https://upload.wikimedia.org/wikipedia/commons/4/42/William_Sealy_Gosset.jpg License:
Public domain Contributors: scanned from Gossets obituary in Annals of Eugenics Original artist: User Wujaszek on pl.wikipedia