# Suggested answer to exercise: Two sample t test for the energy expenditure data, 1

Question 1: Compare the mean energy expenditure between lean and obese women using the two sample t test. Report the mean and its confidence interval to two decimal places.

Click Analyze, Compare Means, Independent-Samples T Test. Choose Test Variable '24 hour enegrgy exenditure'. Choose Grouping Variable 'Group of women'. Click Define Groups. Choose Use specified values and put 1 into the Group 1 box and 2 into the Group 2 box. Click . Click OK.

You should get the following output:

Group Statistics
Group of women   N   Mean Std. Deviation Std. Error Mean
24 hour energy expenditure (MJ) Lean 13 8.0662 1.23808 .34338
Obese 9 10.2978 1.39787 .46596

Independent Samples Test
Levene's Test for Equality of Variances t-test for Equality of Means
F Sig.         t         df Sig.(2-tailed) Mean Difference Std. Error Difference 95% Confidence Interval of the Difference
Lower Upper
24 hour energy expenditure (MJ) Equal variances assumed 1.002
.329
-3.946 20 .001 -2.23162 .56560 -3.41145 -1.05180
Equal variances not assumed -3.856 15.919 .001 -2.23162 .57882 -3.45917 -1.00408

The first table shows the two groups separately. The second table shows the results of three different tests:

• the Levene test,
• the standard two sample t test assuming equal variances,
• the two sample t test not assuming equal variances, using the Satterthwaite approximation to reduce the degrees of freedom.

The Levene test comes first. This tests the null hypothesis that the variances are the same in the two populations. Here the test gives P = 0.329, or just P = 0.3. Hence the test is not significant.

Next comes the standard t test, when we assume equal variances in the two populations. This gives a t statistic, t = −3.946, which we would usually quote to 2 decimal places, t = −3.95. We then have degrees of freedom = 20, the P value, P = 0.001, mean difference, its standard error, and 95% confidence inteval.

Finally, we have the unequal variance t test, when we do not assume equal variances in the two populations. This gives a smaller t statistic, t = −3.856, to 2 decimal places t = −3.86. We then have degrees of freedom = 15.919. This is less than 20 for the standard t test and is not a whole number. The Satterthwaite approximation is that we can replace numbers from the t distribution with 20 degrees of freedom by those with 15.919 degrees of freedom, or in practice 16 degrees of freedom. The P value is P = 0.001, as for the equal variance option, but this disguises a difference which would be apparent if we had 4 decimal places. The P values are in fact 0.0008 for equal variances and 0.0014 for unequal variances. Both of these are 0.001 to 3 decimal places. We then have the mean difference, which is unchanged, its standard error, which is slightly larger, and the 95% confidence inteval, which is wider.

There is not reason to think that the variances are different in the two populations, so I would use the standard t test. In a paper I would report that the mean difference (lean minus obese) was −2.23 MJ, 95% confidence interval −3.41 to −1.05 MJ, P = 0.001. In a statistical report I would include the t statistic and degrees of freedom: mean difference (lean minus obese) was −2.23 MJ, 95% confidence interval −3.41 to −1.05 MJ, t = −3.95, df = 20, P = 0.001.

This is for the difference lean minus obese. We could get rid of the minus signs by reporting that the mean difference, obese minus lean, was 2.23 MJ, 95% confidence interval 1.05 to 3.41 MJ, P = 0.001. Note that reversing the direction means that the upper end of the confidence inteval is switched around, too.

Note that we should always include the units of measurement where they exist. We should also say in which direction the difference has been calculated.