# Normality test for t-test

I ran the Kolmogorov test on a sample and its results showed that the data was significantly drawn from a normally distributed population. Then I assumed that data is suitable for applying t-test. But now I want to know is enough?

• Just to clarify, you surely mean that the Shapiro-Wilk test did not reject normality? Mar 13, 2015 at 21:05
• Note that the edit under my name is the author's (radical) revision of their own question, together with edits of my own. Mar 14, 2015 at 8:20
• I see in a (deleted) question that was posed in an answer that you mention n=2000. Do you have n=2000 in your data? What do your data look like? Mar 14, 2015 at 9:38

The question has altered ... quite a lot. My answer relates to the question as originally asked (which was a decent question). I'll add a little at the end to discuss the change to the test from Shapiro-Wilk to Kolmogorov-Smirnov.

I ran Shapro-Wilk test [...] and its results showed that the data was significantly drawn from a normally distributed population.

Sorry, but it didn't show anything of the kind.

Not rejecting does not give you any ability to make any statement that asserts normality.

Failure to reject normality is merely a failure to detect the non-normality that you almost certainly have. Making a type II error is little consolation.

Then I assumed that data is suitable for applying paired t-test.

A formal hypothesis test of assumptions is generally a bad idea for several reasons -

1) it answers the wrong question. The question of interest is not "are the data drawn from a normal distribution?" (We know the answer to that already -- they aren't). The question of interest is "how badly does that impact the properties of the procedure we wish to apply?". That's more an 'effect size' type question. A suitable diagnostic display, perhaps combined with some simulation might give us some sense of that impact -- but the hypothesis test generally doesn't. If the sample size is large it will cause us to reject even small deviations from normality - even though in large samples many procedures aren't very sensitive to non-normality; in large samples we're likely to reject when the impact on our inference is negligible - so often rejection is of little consequence for the properties of our original inference. On the other hand in small samples we're very unlikely to be able to reject, but in small samples having a distribution close to normality will matter more -- which is to say failure to reject should be of no comfort at all.

2) choosing which test we do on the basis of a test of normality affects the properties of the inferential procedures we're choosing between. Which is to say our tests don't have the selected properties (like significance level or power) that we think they do.

But now I want to know is this test enough to claim that the variable has finite mean and variance?

No. You can fail to reject even if that's not the case.

Here's an example in R. I generate a sample of size 9 from a $t_2$ distribution (which doesn't have finite variance), yet fail to reject normality at any typical significance level:

> x9=rt(9,2);shapiro.test(x9)

Shapiro-Wilk normality test

data:  x9
W = 0.9049, p-value = 0.2815


Indeed, at the 5% level you'd fail to reject more than 70% of $t_2$ distributed samples at $n=9$.

That's just the first case I tried - no doubt it would be possible to find other distributions against which the Shapiro-Wilk has even less power**.

Just in case you think it's only because I chose $n=9$, here's a couple at $n=30$:

 > x30=rt(30,2);shapiro.test(x30)

Shapiro-Wilk normality test

data:  x30
W = 0.9351, p-value = 0.06732

> x30a=rt(30,2);shapiro.test(x30a)

Shapiro-Wilk normality test

data:  x30a
W = 0.95, p-value = 0.1689


There's better than a 30% chance of not rejecting at n=30.

**[Indeed, I subsequently did find a distribution with a substantially lower chance of rejection but still with infinite variance (a mixture of a $t_2$ and a scaled, shifted $\text{beta}(3,3)$). With the particular one I looked at, even at n=100 you'd only reject normality about 1 time in 6 --- and I could make that rejection rate much closer to $\alpha$ by manipulating the scaling of the beta and the mixing fraction that was $t_2$. If instead I made a mixture that included a small proportion of a Cauchy, the mean would not be finite either.]

Hopefully you can appreciate that failure to reject really doesn't tell you that the mean and variance are finite.

It certainly doesn't suggest that the distribution is anywhere close to normal.

Now everything I said about the Shapiro-Wilk applies to the Kolmogorov-Smirnov as well.

Which is to say:

• Not rejecting with the Kolmogorov-Smirnov test does not give you any ability to make any statement that asserts normality either.

• A formal hypothesis test of assumptions is generally a bad idea for several reasons, as discussed above.

• failure to reject normality should give you no comfort -- it doesn't tell you anything about the impact on your inference of the degree of non-normality you have. Indeed, because the Kolmogorov-Smirnov generally has less power against alternatives of interest than the Shapiro-Wilk, failure to reject should be even less comforting than before.