Comparison of t-test results in Excel

The following two series of data were analyzed using three different assumptions for the t-test in Excel. All analyses tested the null hypothesis that there was no difference between the two columns of data. The first analysis assumed the two columns of data were drawn from the same subjects (e.g., before and after experimental treatment). Note that it has only 9 degrees of freedom, reflecting the fact that there are only 10 subjects involved. This amounts to the same thing as testing that the average row-by-row differences between the two columns is zero. Other statistics packages (e.g. SPSS and R) allow you to input a single list of numbers representing these differences. This t-test would be significant, that is, we can reject the null hypothesis of no difference, whether it is a one-tail or a two-tailed test.

The second table shows what the t-test would be like if the two columns of data were drawn from separate independent samples (e.g., two groups of randomly sampled subjects, one an untreated control group and the other a treated experimental group). Note that in this case, there are 18 degrees of freedom and the t statistic is now 1.897 as opposed to 3.857 for the matched sample case. The value of t is smaller now because we do not get to remove variability due to the subjects from the denominator. The t-test is still significant at the 0.05 level for a one-tail test, but it is non-significant for a two tailed test.

In the third example, we do not assume that the two groups have equal variance. This results in an adjustment to the degrees of freedom and a further increase in the calculated p value.

25 26
36 28
42 32
20 20
30 25 t-Test: Paired Two Sample for Means
29 24
31 30   Variable 1 Variable 2
45 33 Mean 31.8 26.6
27 22 Variance 57.51111111 17.6
33 26 Observations 10 10
Pearson Corr. 0.894755554
Hypothesized Mean Difference 0
df 9
t Stat 3.856851776
P(T<=t) one-tail 0.001932808
t Critical one-tail 1.833112923
P(T<=t) two-tail 0.003865617
t Critical two-tail 2.262157158  
t-Test: Two-Sample Assuming Equal Variances
  Variable 1 Variable 2
Mean 31.8 26.6
Variance 57.51111111 17.6
Observations 10 10
Pooled Variance 37.55555556
Hypothesized Mean Difference 0
df 18
t Stat 1.897366596
P(T<=t) one-tail 0.036970099
t Critical one-tail 1.734063592
P(T<=t) two-tail 0.073940198
t Critical two-tail 2.100922037  
t-Test: Two-Sample Assuming Unequal Variances
  Variable 1 Variable 2
Mean 31.8 26.6
Variance 57.51111111 17.6
Observations 10 10
Hypothesized Mean Difference 0
df 14
t Stat 1.897366596
P(T<=t) one-tail 0.039299221
t Critical one-tail 1.761310115
P(T<=t) two-tail 0.078598443
t Critical two-tail 2.144786681