Two way anova with unequal variance

Hi all. I would like to run a 2 way anova on some data investigating main effects and interactions. I am using R to do the analysis.

I have performed a levene test (code is leveneTest(dependent variable ~ independent variable 1 * ind var 2, center = median, data)

I get a very significant output stating that there is heterogeneity within the data (p<0.01).

It's my understanding that a welch anova can be used if you have 1 factor (IE alternative to 1 way ANOVA), but it's not clear to me what the approach would be for a multi-factor analysis.

I have read that weighted least squares regression and robust standard errors are an option for heterogeneity and heteroscedasticity, but the guides I read are normally geared towards linear regression rather than running an ANOVA. Can these approaches be used for a 2 way ANOVA, and if so, could you advise on the code?

Likewise, would it be more advisable to perform a Scheirer-Ray-Hare test (IE. non parametric alternative to 2 way ANOVA)?

Any advice would be appreciated, thanks in advance.

Performing a normality or homoscedasticity test before t-test or ANOVA is tricky. I found these test are either under- or overpowered, that is with small data set they always provide large p-values and with large data sets they return "significant" p-values, because they detect small departures from the assumed distributions. Nothing is perfectly normal or homoscedastic in nature. The important part is the effect size. ANOVA is robust to small departures from normality and homoscedasticity.

I would recommend eyeballing your data. Make a plot. Do variances look very different between groups? Can they be reduced be a simple transformation, for example, a logarithm? Default ANOVA might be just fine. If not, you might search for answers beyond this forum (e.g. What to do with non-normality and heterogeneous variances in two-way ANOVA when transformations do not work? - Cross Validated).

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.