I'd like to perform an ANOVA with a normally distributed response variables and several explanatory variables. Some of the explanatory variables are continuous and some are categorical (factor(..)).
aov(a~numeric(b) + factor(c ) + numeric(d) + factor(e))
The residuals of this model are perfectly normally distributed but the assumption of homoscedasticity is not respected. What can I do?
- Welch correction?
- Does it work for multiple way ANOVA? How can we perform such a thing with R?
- ordered logic model?
- I tried the function
polr(in R) but I get an error message saying that the response should be a factor
- I tried the function
- Friedman test?
- I tried but I got an error message saying that the formula is incorrect (although it is exactly the same as for aov(..))
- Kruskal.wallis?
- It works only for one-way Anova I think.
Update
m = aov(myFormula, myData)
plot(y=residuals(m), x=m$fit)
abline(lm(residuals(m)~m$fit))

aovfits a general linear model - usually called regression rather than ANOVA, even though you may want to look at an ANOVA table. – Scortchi - Reinstate Monica Nov 18 '13 at 13:56plot(residuals(m), predict(m))? (wherem = aov(myFormula, myData)) or doing this:summary(lm(predict(m)~residuals(m)))? Or something else? – Remi.b Nov 18 '13 at 14:22sandwich(m)andvcovHC(m, type = "HC")and I get a 30*30 matrix. What does it mean? Thanks a lot for your help @Scortchi – Remi.b Nov 18 '13 at 16:32sandwichin R! It's giving you a robust estimate of the variance-covariance matrix for your model's coefficients, from which you can calculate their standard errors; all without assuming homoskedasticity of the error terms. – Scortchi - Reinstate Monica Nov 18 '13 at 16:51