Assumption tests other than Sphericity when using ezANOVA for repeated measures? (Levene's, Shapiro-Wilks)

530 views
Skip to first unread message

Megan Kelso

unread,
Apr 17, 2018, 9:08:44 PM4/17/18
to ez4r
Hello,
Sorry if this was answered somewhere else and I missed it when I searched the google group archive. 

I'm using ezANOVA to do a repeated measures test. I have 2 between-subject fixed factors (Nutrient, Site) and one within-subject factor (Year). In my output, I get an ANOVA table, sphericity test results, and an adjusted ANOVA table (all awesome!). But I didn't get output for the Levene's Test for homogeneity of variances. Looking in the documentation, it says you only get results for Levene's Test if the design is strictly between-Ss. Is there a way to run Levene's Test when you do have a within-Ss factor? I *think* this is still an assumption of the repeated measures ANOVA, but perhaps I'm wrong about that. 

I also thought I needed to test for normality (e.g. Shapiro Wilks). Is there an example somewhere of how to do that with ezANOVA (or by passing its output to another function)? Or, is that test not needed? 

Thanks so much for any guidance!
My best,
Megan

Mike Lawrence

unread,
Apr 17, 2018, 9:57:31 PM4/17/18
to ez...@googlegroups.com
How many levels of Year do you have? If just two, you could simply collapse it to a difference score to yield a fully between-Ss design and consequent Levene tests.

Otherwise, yes, ez isn't great at doing all the pertinent assumption checks. When I developed it, I simply wanted to mimic what SPSS provided as output at the time, and have subsequently moved on to other more powerful inferential tools (explicit generative models evaluated using Bayesian tools with posterior predictive checks for assessing/amending model assumptions) and haven't put any further time into making ez more fully-featured. Maybe take a look at the afex package to see what it provides check-wise?




--
Mike Lawrence
Graduate Student
Department of Psychology & Neuroscience
Dalhousie University

~ Certainty is (possibly) folly ~

--
You received this message because you are subscribed to the Google Groups "ez4r" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ez4r+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thom

unread,
Apr 18, 2018, 10:50:40 AM4/18/18
to ez4r

For within factors the issue manifests as sphericity. There is no homogeneity of variance function per se. This is addressed by looking at the corrected tests in ANOVA output - as I believe ez gives the HF and GG corrections. If these corrections are different from the uncorrected tests it is appropriate to use one of the corrections.


In general checks of assumptions in the form of significance tests are vastly over-rated. The checks themselves assume things such as normality and often lack power.

For a mixed design you assume multi-sample sphericity which is harder to check and deal with and homogeneity of variance for the between factors only. These assumptions are part of the requirements of using an F statistic to calculate p values. You can side-step this by using a Bayesian approach as Mike suggests (perhaps worth it only for complex designs).

Thom
To unsubscribe from this group and stop receiving emails from it, send an email to ez4r+uns...@googlegroups.com.

Megan Kelso

unread,
Apr 20, 2018, 8:35:03 PM4/20/18
to ez4r
Hi Mike and Thom, 
Thank you for the speedy replies! I really appreciate it. 

Mike: I have 3 levels of year, so unfortunately I can't collapse it into a difference. I looked at the documentation for the afex package and it doesn't seem to do checks for the assumptions of normality of residuals or homogeneity of variances. 

Thom: You mention that I only need to check homogeneity of variances for the between-factors. Could I do that by pretending all the data came from one year and then doing a Levene's test for my 2 fixed factors (Site and NutLev)? e.g.: leveneTest(dependent_var ~ Site*NutLev, data=mydata). A second question: When you say a mixed design assumes multi-sample sphericity, is that different than the sphericity that is tested for in Mauchly's test? 

As for the Shapiro Wilks test, does it sound acceptable to pretend all the data came from one year and test normality of all the residuals lumped together?

Going off what Thom said about significance tests being vastly over-rated, I've had some folks recommend just looking at residuals plots, plots of the data, and QQ plots to get a sense for normality of residuals and homogeneity of variance and not worrying about Shapiro Wilks and Levene's testing. I'd be interested to hear your thoughts on this. 

Thank you again,
Megan

Thom

unread,
Apr 21, 2018, 9:46:21 AM4/21/18
to ez4r

1) I would just look at the SDs in each group and see if they are similar. You need quite big differences in SDs to make a difference unless you have very unequal n per group. You can always conduct a Levene test from the raw data. It is just an ANOVA with the absolute differences from the average score replacing the raw scores. The average score can be selected in different ways - default SPSS uses the mean but the deviations from the group medians are more robust.

2) Multisample sphericity assumes that the pattern of covariances are similar in each group. The GG or HF corrections don't address this. It would be OK to assume it holds if the epsilon estimates are all close to 1.

3) Yes - I'd use graphical methods to inspect the residuals. I also like to use descriptive stats - simply looking at the SDs in each group and the epsilon estimates is useful. For example if you have two groups with equal n and SDs are 1.2 and 1.6 that's probably not too alarming - if they are 1.2 and 4.3 you've got an issue. The degree of violation tells you how serious any problems are. So if you get p < .000001 and the assumptions are mildly violated the test statistics won't accurate but it does not matter much. For violation of sphericity power is always reduced (so not using a correction always inflates Type I error unless epsilon = 1 such as when you have 2 levels), but for other violations that might not be the case.

Thom
Reply all
Reply to author
Forward
0 new messages