2
$\begingroup$

I am new to the world of stats...

My data had a log normal distribution, so transformed by log to get it nearer normal distribution. This is real-world data.

From here I want to establish if my data is normal for parametric tests (ANOVA tests for differences in groups and then Tukey HSD to find out which groups are different).

So i ran a few tests in R:

Median =  1.249979
Mean =  1.278969
Skewness =  0.3918898
Kurtosis = -0.1024776

Shapiro-Wilk normality test
data:  mergedbedanova$logwinterCV
W = 0.98709, p-value = 0.01769

The Shapiro-Wilk test suggests that my data is not normal.

Histogram of data

enter image description here

enter image description here

Question

Is this data normal or 'normal enough' for parametric testing? Or do i need to look at non-parametric tests?

$\endgroup$
  • $\begingroup$ What is your sample size per group? Assumption of ANOVA is not normality of the data but normality of the residuals (see stats.stackexchange.com/questions/6350/…). Further, with large N, Shapiro-Wilk tests tends to detect already quite small deviations from normal distribution. For large N, Central Limit Theorem provides a nice foundation to use ANOVA $\endgroup$ – LuckyPal Jan 22 '19 at 15:44
  • $\begingroup$ I am running lots of individual ANOVA's based on different groups. One typical set of groups: N=55,65,69,40,24,7 and 5. $\endgroup$ – Cairan Van Rooyen Jan 22 '19 at 16:17
  • $\begingroup$ The total N=265 observations (participants) $\endgroup$ – Cairan Van Rooyen Jan 22 '19 at 16:38
  • $\begingroup$ There are two issues here. The main one is that you should not expect the aggregate data to be normal even if the data have normal errors as specified in a linear model. I illustrate this for one simple case in my Answer. [Second, even if there is a slight departure from required normality, results of analysis such as a t test, ANOVA, or linear regression may be useful.] $\endgroup$ – BruceET Jan 22 '19 at 18:23
  • 1
    $\begingroup$ @LuckyPal The CLT alone doesn't get you there because the ANOVA test statistic isn't an externally standardized sample mean. You need more than the CLT because you need to deal with the denominator in the F. With the addition of another theorem, in the limit $n\to\infty$ it will give a foundation for getting correct type I error rates, but the CLT (etc) doesn't fix the (potentially substantial) issue with low efficiency (low power near H0) $\endgroup$ – Glen_b Jan 23 '19 at 2:39
1
$\begingroup$

You should test the residuals in a one-way ANOVA to see if they are normal. Especially if the levels of the factor are significantly different, there is no reason to expect the aggregate data to be normal.

As an example, suppose the factor has three levels. Then the data for the three levels separately might be as generated below in R, so that we know the conditions for a one-way ANOVA are precisely met:

set.seed(122)
x1 = rnorm(50, 100, 12)
x2 = rnorm(50, 105, 12)
x3 = rnorm(50, 135, 12)
x = c(x1, x2, x3)
shapiro.test(x)

        Shapiro-Wilk normality test

data:  x
W = 0.98219, p-value = 0.04922

However, the Shapiro-Wilk test suggests that the aggregate data are not normal. Also, the kernel density estimator plotted through their histogram below shows right skewness somewhat similar to the data you show.

enter image description here

The residuals for this model are $X_{ij} - A_i,$ for $i = 1,2,3; j = 1, \dots, 50;$ where $A_i = \sum_j X_{ij}.$

Specifically, for my fake data, the Shapiro-Wilk test shows that the 150 residuals are consistent with normality:

r = c(x1-mean(x1), x2-mean(x2), x3-mean(x3))  
    shapiro.test(r)

        Shapiro-Wilk normality test

data:  r
W = 0.99134, p-value = 0.4933
| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Great, thank you. I will test residuals instead of the original data. I will post results soon. Is there any other tests i need to do for ANOVA? I have read about equal variances... $\endgroup$ – Cairan Van Rooyen Jan 22 '19 at 18:17
  • $\begingroup$ Yes, for a traditional one-way ANOVA, you should check for equal variances. Alternatively, you might use a Welch one-say ANOVA, which does not require equal variances. $\endgroup$ – BruceET Jan 22 '19 at 18:28
0
$\begingroup$

To trust the p-values produced by ANOVA and the post-hoc comparisons, the residuals must be normally distributed. In general, you have two options:

  1. Check whether the data within each group is normally distributed (although this is not an assumption of ANOVA, it will usually lead to normally distributed residuals)
  2. Check whether the residuals of your ANOVA are normally distributed

Regarding option 1: it is quite difficult to assess normality when one or several of the groups have N < ~30. Hence option 2 might be more promising. Example code to do so in R using the iris dataset is:

fit1 <- aov(Sepal.Length ~ Sepal.Width, data=iris)
qqnorm(fit1$residuals)
hist(fit1$residuals)

But again, the questions arises: when is normality assumption violated? In many cases, there is no correct answer to this.

However, if all you want to do is comparing those groups and you are not explicitly focussed on fitting a linear model, you cannot do much wrong with choosing non-parametric tests like Kruskal-Wallis and post-hoc adjusted Mann-Whitney tests.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ OK, i have re-run the tests using K-W and found the same significance as ANOVA's, which is great news, as I have spent allot of time analysing the previous ANOVA results and what that means. All i need to do now is test the residuals for normal distribution. $\endgroup$ – Cairan Van Rooyen Jan 22 '19 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.