7 Between-Subjects Student's t-test
between-subjects t-test: Compare two groups or conditions where the participants are different in each group and have not been matched or are only matched on broad demographics, e.g. only age.
7.1 The Worked Example
Here is your data:
Group | N | Mean | SD |
---|---|---|---|
A | 18 | 25.58 | 2.25 |
B | 18 | 29.07 | 2.53 |
Let's look at the main t-test formula:
t=ˉX1−ˉX2sp×√1N1+1N2
Now, from the table above we know:
- the mean of Group A is ¯X1=25.58,
- the mean of Group B is ¯X2=29.07,
- the N of Group A is N1=18,
- and the N of Group B is N2=18,
which we can put into the equation right now:
t=25.58−29.07sp×√118+118
And now we can see that the only thing we don't yet know is the pooled standard deviation (sp). Let's look at that formula:
Calculating the pooled standard deviation
sp=√(n1−1)×s2X1+(n2−1)×s2X2n1+n2−2
And if we start to fill in some details:
sp=√(18−1)×s2X1+(18−1)×s2X218+18−2
Now looking at the formula, it is clear we are missing:
- s2X1 - the variance of Group A (could be written as s2A)
- s2X2 - the variance of Group B (could be written as s2B)
What we do know though, from the table, is the standard deviations of both groups (SDA = 2.25; SDB = 2.53), and we know that variance of a group is equal to the standard deviation squared. So:
- s2X1 = s2A = SDA×SDA = 2.25×2.25 = 5.0625
- s2X2 = s2B = SDB×SDB = 2.53×2.53 = 6.4009
And if we now add those values to our formula we get:
sp=√(18−1)×5.0625+(18−1)×6.400918+18−2
And we can then start working through the formula, taking each stage in turn to make sure we don't make mistakes. Let's get rid of the brackets first:
sp=√(17×5.0625)+(17×6.4009)34
Now we deal with the multiplications:
sp=√86.0625+108.815334
Let's tidy up that top half of the equation (the numerator):
sp=√194.877834
Which if we then divide the numerator by the denominator (the bottom half), and then take the square root of that we get:
sp=√5.7317
Giving a pooled standard deviation of:
sp=2.3940969
Meaning that our pooled standard deviation, rounded to three decimal places, is sp=2.394 and we can now add that to the t-test formula to give us:
Calculating the t-value
t=25.58−29.072.394×√118+118
And again we just start working through the formula. Let's deal with the fractions relating to sample size first:
t=25.58−29.072.394×√0.0555556+0.0555556
Which we can tidy up a little to give:
t=−3.492.394×√0.1111111
And if we sort out the square root on the denominator we are left with:
t=−3.492.394×0.3333333
We can then tidy up the denominator to give us:
t=−3.490.798
Which we can finally solve to give us a t-value, rounded to two decimal places, of t=−4.37
Degrees of Freedom
Great! Now we just need the degrees of freedom where the formula is:
df=(n1−1)+(n2−1)
And we already know that:
- the N of Group A is N1=18,
- and the N of Group B is N2=18,
So putting them into the equation we get:
df=(18−1)+(18−1) df=17+17 df=34
Effect Size: Cohen's d
And finally Cohen's d, the effect size:
d=2t√df
Which, based on the info above, we know:
- t=−4.37
- df=34
Putting them into the formula we get:
d=2×−4.37√34
And if we tidy the nominator and the denominator we get:
d=−8.745.8309519
Which we can then solve to learn that d=−1.5
Determining Significance
If we were to look at a critical values look-up table for df=34 and α=.05 (two-tailed), we would see that the critical value is tcrit=2.032. Given that our t-value, ignoring polarity and just looking at the absolute value, so t=4.37, is equal to or larger than our tcrit then we can say our result is significant, and as such would be written up as t(34) = 4.37, p < .05, d = 1.5
Remember: If you were writing this up as a report, and analysis the data in R, then you would see the p-value was actually p = 1.1081944^{-4}, and would be written up as p < .001
7.2 Test Yourself
7.2.1 DataSet 1
Here is your data:
Group | N | Mean | SD |
---|---|---|---|
A | 5 | 68.01 | 0.34 |
B | 5 | 67.80 | 0.67 |
Let's look at the main t-test formula:
t=ˉX1−ˉX2sp×√1N1+1N2
Now, from the table above we know:
- the mean of Group A is ¯X1=68.01,
- the mean of Group B is ¯X2=67.8,
- the N of Group A is N1=5,
- and the N of Group B is N2=5,
which we can put into the equation right now:
t=68.01−67.8sp×√15+15
And now we can see that the only thing we don't yet know is the pooled standard deviation (sp). Let's look at that formula:
sp=√(n1−1)×s2X1+(n2−1)×s2X2n1+n2−2
And if we start to fill in some details:
sp=√(5−1)×s2X1+(5−1)×s2X25+5−2
Now looking at the formula, it is clear we are missing:
- s2X1 - the variance of Group A (could be written as s2A)
- s2X2 - the variance of Group B (could be written as s2B)
What we do know though, from the table, is the standard deviations of both groups (SDA = 0.34; SDB = 0.67), and we know that variance of a group is equal to the standard deviation squared. So:
- s2X1 = s2A = SDA×SDA = 0.34×0.34 = 0.1156
- s2X2 = s2B = SDB×SDB = 0.67×0.67 = 0.4489
And if we now add those values to our formula we get:
sp=√(5−1)×0.1156+(5−1)×0.44895+5−2
And we can then start working through the formula, taking each stage in turn to make sure we don't make mistakes. Let's get rid of the brackets first:
sp=√(4×0.1156)+(4×0.4489)8
Now we deal with the multiplications:
sp=√0.4624+1.79568
Let's tidy up that top half of the equation (the numerator):
sp=√2.2588
Which if we then divide the numerator by the denominator (the bottom half), and then take the square root of that we get:
sp=√0.28225
Giving a pooled standard deviation of:
sp=0.5312721
Meaning that our pooled standard deviation, rounded to three decimal places, is sp=0.531 and we can now add that to the t-test formula to give us:
t=68.01−67.80.531×√15+15
And again we just start working through the formula. Let's deal with the fractions relating to sample size first:
t=68.01−67.80.531×√0.2+0.2
Which we can tidy up a little to give:
t=0.210.531×√0.4
And if we sort out the square root on the denominator we are left with:
t=0.210.531×0.6324555
We can then tidy up the denominator to give us:
t=0.210.3358339
Which we can finally solve to give us a t-value, rounded to two decimal places, of t=0.63
Great! Now we just need the degrees of freedom where the formula is:
df=(n1−1)+(n2−1)
And we already know that:
- the N of Group A is N1=5,
- and the N of Group B is N2=5,
So putting them into the equation we get:
df=(5−1)+(5−1) df=4+4 df=8
And finally Cohen's d, the effect size:
d=2t√df
Which, based on the info above, we know:
- t=0.63
- df=8
Putting them into the formula we get:
d=2×0.63√8
And if we tidy the nominator and the denominator we get:
d=1.262.8284271
Which we can then solve to learn that d=0.45
Determining Significance
If we were to look at a critical values look-up table for df=8 and α=.05 (two-tailed), we would see that the critical value is tcrit=2.306. Given that our t-value, ignoring polarity and just looking at the absolute value, so t=0.63, is smaller than our tcrit then we can say our result is non-significant, and as such would be written up as t(8) = 0.63, p > .05, d = 0.45
Remember: If you were writing this up as a report, and analysis the data in R, then you would see the p-value was actually p = 0.5462633, and would be written up as p = 0.548
7.2.2 DataSet 2
Here is your data:
Group | N | Mean | SD |
---|---|---|---|
A | 47 | 66.18 | 1.79 |
B | 47 | 66.42 | 1.78 |
Let's look at the main t-test formula:
t=ˉX1−ˉX2sp×√1N1+1N2
Now, from the table above we know:
- the mean of Group A is ¯X1=66.18,
- the mean of Group B is ¯X2=66.42,
- the N of Group A is N1=47,
- and the N of Group B is N2=47,
which we can put into the equation right now:
t=66.18−66.42sp×√147+147
And now we can see that the only thing we don't yet know is the pooled standard deviation (sp). Let's look at that formula:
sp=√(n1−1)×s2X1+(n2−1)×s2X2n1+n2−2
And if we start to fill in some details:
sp=√(47−1)×s2X1+(47−1)×s2X247+47−2
Now looking at the formula, it is clear we are missing:
- s2X1 - the variance of Group A (could be written as s2A)
- s2X2 - the variance of Group B (could be written as s2B)
What we do know though, from the table, is the standard deviations of both groups (SDA = 1.79; SDB = 1.78), and we know that variance of a group is equal to the standard deviation squared. So:
- s2X1 = s2A = SDA×SDA = 1.79×1.79 = 3.2041
- s2X2 = s2B = SDB×SDB = 1.78×1.78 = 3.1684
And if we now add those values to our formula we get:
sp=√(47−1)×3.2041+(47−1)×3.168447+47−2
And we can then start working through the formula, taking each stage in turn to make sure we don't make mistakes. Let's get rid of the brackets first:
sp=√(46×3.2041)+(46×3.1684)92
Now we deal with the multiplications:
sp=√147.3886+145.746492
Let's tidy up that top half of the equation (the numerator):
sp=√293.13592
Which if we then divide the numerator by the denominator (the bottom half), and then take the square root of that we get:
sp=√3.18625
Giving a pooled standard deviation of:
sp=1.785007
Meaning that our pooled standard deviation, rounded to three decimal places, is sp=1.785 and we can now add that to the t-test formula to give us:
t=66.18−66.421.785×√147+147
And again we just start working through the formula. Let's deal with the fractions relating to sample size first:
t=66.18−66.421.785×√0.0212766+0.0212766
Which we can tidy up a little to give:
t=−0.241.785×√0.0425532
And if we sort out the square root on the denominator we are left with:
t=−0.241.785×0.2062842
We can then tidy up the denominator to give us:
t=−0.240.3682174
Which we can finally solve to give us a t-value, rounded to two decimal places, of t=−0.65
Great! Now we just need the degrees of freedom where the formula is:
df=(n1−1)+(n2−1)
And we already know that:
- the N of Group A is N1=47,
- and the N of Group B is N2=47,
So putting them into the equation we get:
df=(47−1)+(47−1) df=46+46 df=92
And finally Cohen's d, the effect size:
d=2t√df
Which, based on the info above, we know:
- t=−0.65
- df=92
Putting them into the formula we get:
d=2×−0.65√92
And if we tidy the nominator and the denominator we get:
d=−1.39.591663
Which we can then solve to learn that d=−0.14
Determining Significance
If we were to look at a critical values look-up table for df=92 and α=.05 (two-tailed), we would see that the critical value is tcrit=1.986. Given that our t-value, ignoring polarity and just looking at the absolute value, so t=0.65, is smaller than our tcrit then we can say our result is non-significant, and as such would be written up as t(92) = 0.65, p > .05, d = 0.14
Remember: If you were writing this up as a report, and analysis the data in R, then you would see the p-value was actually p = 0.517312, and would be written up as p = 0.513
7.2.3 DataSet 3
Here is your data:
Group | N | Mean | SD |
---|---|---|---|
A | 8 | 31.80 | 0.42 |
B | 8 | 32.18 | 0.57 |
Let's look at the main t-test formula:
t=ˉX1−ˉX2sp×√1N1+1N2
Now, from the table above we know:
- the mean of Group A is ¯X1=31.8,
- the mean of Group B is ¯X2=32.18,
- the N of Group A is N1=8,
- and the N of Group B is N2=8,
which we can put into the equation right now:
t=31.8−32.18sp×√18+18
And now we can see that the only thing we don't yet know is the pooled standard deviation (sp). Let's look at that formula:
sp=√(n1−1)×s2X1+(n2−1)×s2X2n1+n2−2
And if we start to fill in some details:
sp=√(8−1)×s2X1+(8−1)×s2X28+8−2
Now looking at the formula, it is clear we are missing:
- s2X1 - the variance of Group A (could be written as s2A)
- s2X2 - the variance of Group B (could be written as s2B)
What we do know though, from the table, is the standard deviations of both groups (SDA = 0.42; SDB = 0.57), and we know that variance of a group is equal to the standard deviation squared. So:
- s2X1 = s2A = SDA×SDA = 0.42×0.42 = 0.1764
- s2X2 = s2B = SDB×SDB = 0.57×0.57 = 0.3249
And if we now add those values to our formula we get:
sp=√(8−1)×0.1764+(8−1)×0.32498+8−2
And we can then start working through the formula, taking each stage in turn to make sure we don't make mistakes. Let's get rid of the brackets first:
sp=√(7×0.1764)+(7×0.3249)14
Now we deal with the multiplications:
sp=√1.2348+2.274314
Let's tidy up that top half of the equation (the numerator):
sp=√3.509114
Which if we then divide the numerator by the denominator (the bottom half), and then take the square root of that we get:
sp=√0.25065
Giving a pooled standard deviation of:
sp=0.5006496
Meaning that our pooled standard deviation, rounded to three decimal places, is sp=0.501 and we can now add that to the t-test formula to give us:
t=31.8−32.180.501×√18+18
And again we just start working through the formula. Let's deal with the fractions relating to sample size first:
t=31.8−32.180.501×√0.125+0.125
Which we can tidy up a little to give:
t=−0.380.501×√0.25
And if we sort out the square root on the denominator we are left with:
t=−0.380.501×0.5
We can then tidy up the denominator to give us:
t=−0.380.2505
Which we can finally solve to give us a t-value, rounded to two decimal places, of t=−1.52
Great! Now we just need the degrees of freedom where the formula is:
df=(n1−1)+(n2−1)
And we already know that:
- the N of Group A is N1=8,
- and the N of Group B is N2=8,
So putting them into the equation we get:
df=(8−1)+(8−1) df=7+7 df=14
And finally Cohen's d, the effect size:
d=2t√df
Which, based on the info above, we know:
- t=−1.52
- df=14
Putting them into the formula we get:
d=2×−1.52√14
And if we tidy the nominator and the denominator we get:
d=−3.043.7416574
Which we can then solve to learn that d=−0.81
Determining Significance
If we were to look at a critical values look-up table for df=14 and α=.05 (two-tailed), we would see that the critical value is tcrit=2.145. Given that our t-value, ignoring polarity and just looking at the absolute value, so t=1.52, is smaller than our tcrit then we can say our result is non-significant, and as such would be written up as t(14) = 1.52, p > .05, d = 0.81
Remember: If you were writing this up as a report, and analysis the data in R, then you would see the p-value was actually p = 0.1507698, and would be written up as p = 0.144
7.3 Look-Up table
Remembering that the tcrit value is the smallest t-value you need to find a significant effect, find the tcrit for your df, assuming α=.05. If the t value you calculated is equal to or larger than tcrit then your test is significant.
df | α=.05 |
---|---|
1 | 12.706 |
2 | 4.303 |
3 | 3.182 |
4 | 2.776 |
5 | 2.571 |
6 | 2.447 |
7 | 2.365 |
8 | 2.306 |
9 | 2.262 |
10 | 2.228 |
15 | 2.131 |
20 | 2.086 |
30 | 2.042 |
40 | 2.021 |
50 | 2.009 |
60 | 2 |
70 | 1.994 |
80 | 1.99 |
90 | 1.987 |
100 | 1.984 |