# Normality of residuals vs sample data; what about t-tests?

An addition to the common confusion about normality testing in inferential statistics for general linear models:

I understand the assumption of normality refers to the residuals in ANOVA and regression models, but what about t-tests?

Calculation of the t-statistic uses standard deviation as a measure of dispersion, rather than sums of squares for the F-statistic in ANOVA and regression. If I understand correctly, it is because of this that there is an assumption that the samples are normally distributed (i.e. the sample standard deviation provides an accurate estimate of the population standard deviation). Is this right?

What do you do if the statistical population of the dependent variable is not distributed normally (thus samples are unlikely to be normally distributed)? Is this where transformations fit in?

-
The t-test works just fine in large samples for distributions without heavy tails, even without exact Normality, so long as the variances of the two groups are equal. The unequal variance t-test (which is the default in, say, R) similarly works fine even when the variances are not equal. So, unless you have a tiny sample, and are interested in detecting deviations from the null in which the mean differs between the two groups, then the t-test is valid without transformation. –  guest Dec 12 '12 at 7:45
I'm familiar with the robustness of t-tests (and other GLM's) with respect to 'small' departures from these two assumptions. What I'm interested in is the theoretical aspects of WHY they are assumed (and whether it is the residuals of individual samples or the pooled residuals that are assumed to have a normal distribution)... –  Dean Portelli Dec 14 '12 at 8:03
Classical derivations of t-tests use assumptions of Normal individual residuals to justify the Normal distribution of the between-group difference in means, the distribution of the average squared residuals, and the independence of those two quantities. But the same test is also valid in large samples, without the Normality assumption - so a legitimate answer to your "what do you do" question may be "nothing; just use the t-test". –  guest Dec 15 '12 at 7:15
Note that a t-test is a special case of regression, & that, since the predicted value is the mean, the sample distribution w/in each group is the distribution of the residuals. The 2 groups taken together do not need to be normally distributed, however. If you are interested in the dependent samples t-test, the distribution of the differences is assumed to be normal. For more info on the assumption pertaining only to the residuals, this thread may be helpful: what-if-residuals-are-normally-distributed-but-y-is-not. –  gung Mar 14 '13 at 5:02
Well, I think your question has been covered either by answers or comments, but wanted to note that the same assumption of normality comes into the $F$-test just as much as for the $t$-test, and the behavior is related - the ANOVA $F$-test is somewhat robust to non-normality in the same way the $t$-test is. Indeed, for a single coefficient, the $F$ is simply the square of the $t$. –  Glen_b Aug 20 '13 at 23:33

It's the same for t-tests. There's no need for the data-set as a whole to be normally distributed (& if there is a difference in means between the groups it won't be), only the residuals. Of course, for a t-test, saying the residuals are normally distributed is the same as saying each group is normally distributed.

The distribution of the independent variables (in the case of t-tests it's the group label) is always irrelevant in ANOVA, regression, & the like: you're interested in the distribution of the response variable conditional on given values of the independent variables.

-
I meant to write "dependent" rather than "independent" in the last paragraph. This is fixed. –  Dean Portelli Dec 12 '12 at 6:19
So, if both samples are distributed normally (the distribution of raw scores and residuals being the same shape) then obviously the pooled residuals will be. But what about if the two groups have non-normal and different distributions (e.g. one left-skewed, one right-skewed) which reflect the population distributions? How would this effect the residuals for the WHOLE dataset, testing normality and analysing the data? –  Dean Portelli Dec 12 '12 at 6:22
@Dean; The t-test is not testing Normality, it's testing the hypothesis that the distributions in your two groups are the same (or have the same mean). If you don't want to test that, analyze the data some other way. If you do want to test it, pre-testing for Normality (or equal variance) can do more harm than good, as this test is dependent with the one you ultimately report. –  guest Dec 12 '12 at 7:49
I understand what the tests is used for (it is a comparison of sample means - the difference is the numerator in the formula for the t statistic). My question is about the assumed normal distribution of residuals: which ones (individual samples, pooled residuals)? what do you do when samples come from statistical populations not distributed normally (and samples reflect this)? –  Dean Portelli Dec 14 '12 at 8:13

All the procedures assume conditional normality, not marginal normality.

(Consider: a t-test is an ANOVA with two groups)

If you were to look at the distribution of the two groups separately in a t-test (reducing your ability to detect a common departure from normality, but on the other hand allowing you to see a large difference in the two distributional shapes), it doesn't matter whether or not you subtract the mean because you're still assessing conditional normality.

-
Here's what I think I understand: assumption of normality of residuals applies to the WHOLE dataset or 'model' (i.e. residuals for each group are pooled - with residuals being calculated separately for each group using their group means) NOT the groups individually –  Dean Portelli Dec 12 '12 at 6:22
That is conditional normality, yes –  Glen_b Dec 12 '12 at 7:47
Normality is not the only way to motivate these methods; see my comments above –  guest Dec 12 '12 at 7:47
@guest Can you explain how you think you can motivate the t-test without normality? Note that to get a t-distribution, you not only need the distribution of the numerator to be normal, you need the denominator to have a scaled chi-distribution and the two to be independent. Without that, the tests don't have the claimed distribution (but I don't dispute that testing the assumption of normality, formally or informally, is also going to stuff that up). I think the best you can do is apply Slutsky's theorem and argue for asymptotic normality. How was the t-test motivated by your comment? –  Glen_b Dec 12 '12 at 8:01
@guest obviously you need the CLT. My mention of "you not only need the distribution of the numerator to be normal" was a reference to it. –  Glen_b Dec 13 '12 at 1:11