# Is a paired t-test correct for comparing two groups when there is a confounding variable?

I have two groups of data, one is a group of people at age 5 and the other set of data is the same group of people when they are 8 years old. I want to test if group two (age 8) eat more food under a certain condition, compare to when they were 5 years old.

However, I know that in general kids eat more when they are older, hence, simply a paired t-test would give me the statistical difference, but I wouldn't know if this difference is the result of the age or condition.

I'm wondering what test I can use which would take into account this.

• How is your data formatted? If you have an ID marking out which entry are from which children and each age and have the condition recorded for both groups you might need to format this as a repeated measures problem – Kristofersen Sep 6 '16 at 2:07
• Thanks. I'm not familiar with the repeated measures problem, but after searching in google, I think that's exactly what I need. Also, I believe my data have all the info that you've mentioned. – Mina Sep 6 '16 at 2:48
• I think you need a test that account for the covariate. – SmallChess Sep 6 '16 at 6:46
• All comments above are missing the point. The answer by @Ian_Fin below is correct (+1). – amoeba says Reinstate Monica Sep 6 '16 at 10:49

In general, the approach that would be taken to this would be to have two groups of children. One group would be under the condition, and the other group would not. You would then compare the change in consumption between the children under the condition and the control children, using, for example, a two-way mixed ANOVA to determine whether there is a change in consumption after you've controlled for the natural change that occurs over time.

If you do not have a control condition, however, then there is no statistical test which can compensate for this by controlling for the natural change. All you will be able to do is to use the paired t-test, while accepting that any effect of your condition that you observe will be confounded by the natural change that may occur due to age.

Paired $t$-test is used when the exact items are treated before and after something special occurred on them. In your problem, you would like to examine the effect of age on eating patterns on the same kids.

The paired $t$-test have more one assumption about Normality of the differenced data ($Dif_i = X^{before}_i - X^{after}_i$) that you should check it based on some standard tests like Kolmogorov-Smirnov Test.

• -1. This does not answer the question and provides a misleading advice about KS test. – amoeba says Reinstate Monica Sep 6 '16 at 12:42
• @amoeba Do you know the precise statement about KS test? Just look at Wikipedia, [en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test] to more introduce with this nonparametric test and then talk about your confusion. – Hadi Sep 6 '16 at 13:36
• I do know what KS test is. But the advice to check the normality assumption with a KS test before running a t-test is a bad advice. – amoeba says Reinstate Monica Sep 6 '16 at 13:37
• I don't understand why it is a bad advice? We should assure about the assumptions validity before running the test. – Hadi Sep 6 '16 at 13:40
• – amoeba says Reinstate Monica Sep 6 '16 at 13:42