Student t-Test (Independent and Paired Samples)
Explanation
The Student t-test is used to compare two means, either from two independent or a paired samples. There is also a one-sample version, discussed here.
In case of two independent samples, the test assumes that the variances within each group is equal, for the paired samples this assumption is not needed (McDonald, 2014, p. 182), although there is some discussion on this (see researchgate).
The t-test uses the Student t-distribution. Gosset, using his pseudonym Student, is often referred to as the origin for this distribution, who studied it for the Guiness brewery and got an article published it in 1908. However, the distribution was already known, see for example Helmert (1875; 1876a; 1876b) and Lüroth (1876), or in more general form Pearson (1895). Gosset had send his results to Fisher, and Gosset actually used the population variance, which Fisher changed this to the sample variance. Fisher made the test popular by including it in his textbook (1925).
Performing the Test
click here for the independent samples version
with Excel
Excel file: TS - Student-t (ind samples) (E).xlsm
with stikpetE
To Be Made
without stikpetE
To Be Made
with Python
Jupyter Notebook: TS -Student and Welch t (ind samples) (P).ipynb
with stikpetP
To Be Made
without stikpetP
with R
Jupyter Notebook: TS -Student and Welch t (ind samples) (R).ipynb
with stikpetR
To Be Made
without stikpetR
with SPSS
Formulas
\(t = \frac{\bar{x}_1 - \bar{x}_2}{SE}\)
\(df = n_1 + n_2 - 2\)
\(sig. = 2\times\left(1 - T\left(\left|t\right|, df\right)\right)\)
With:
\(SE = s_p\times\sqrt{\frac{1}{n_1} + \frac{1}{n_2}}\)
\(s_p = \sqrt{\frac{\left(n_1 - 1\right)\times s_1^2 + \left(n_2 - 1\right)\times s_2^2}{df}}\)
\(s_i^2 = \frac{\sum_{j=1}^{n_i} \left(x_{i,j} - \bar{x}_i\right)^2}{n_i - 1}\)
\(\bar{x}_i = \frac{\sum_{j=1}^{n_i} x_{i,j}}{n_i}\)
Symbols used:
- \(x_{i,j}\), the j-th score in category i
- \(n_i\), the number of scores in category i
- \(T\left(\dots\right)\), the cumulative density function of the t-distribution.
See the Student t-distribution section for more details.
Interpreting the Result
The assumption about the population for this test (the null hypothesis) is that the means are equal.
The test provides a p-value, which is the probability of a test statistic as from the sample, or even more extreme, if the assumption about the population would be true. If this p-value (significance) is below a pre-defined threshold (the significance level \(\alpha\) ), the assumption about the population is rejected. We then speak of a (statistically) significant result. The threshold is usually set at 0.05. Anything below is then considered low.
If the assumption is rejected, we conclude that the means in the population will be different.
Note that if we do not reject the assumption, it does not mean we accept it, we simply state that there is insufficient evidence to reject it.
Writing the results
Writing up the results of the test uses the format (APA, 2019 p. 182):
t(<degrees of freedom.>) = <t-value>, p = <p-value>
So for example:
An independent-samples Student t-test indicated that there is insufficient evidence to claim a significant difference in the mean grades given to the course by the Male students (M = 60, SD = 19) and the Female students (M = 54, SD = 26), t(39) = .801, p = .428.
The p-value is shown with three decimal places, and no 0 before the decimal sign. If the p-value is below .0005, it can be reported as p < .001. The abbreviations of 'M' for mean, and 'SD' for standard deviation, are not needed to be explained, they are accepted abbreviation in APA (2019, p. 185).
APA (2019, p. 88) states to also report an effect size measure.
Next...
After this test you might want an effect size measure. Various options are available for this: Common Language, Cohen d_s, Cohen U, Hedges g, Glass delta, biserial correlation, point-biserial correlation
Alternatives
for the two independent samples, the following tests could be considered:
test | equal variance assumption | normality assumption |
---|---|---|
Student | yes | yes |
Welch | no | yes |
Trimmed | yes | no |
Yuen-Welch | no | no |
Google adds