[R] about error while using anova function

Dorian dorian.mitchem at colorado.edu
Fri Feb 3 04:57:14 CET 2012

I don't know what your data look like, but I recently ran into this error
message while using Anova() in the {car} package, and I resolved in by
replacing the categorical predictors in my model with orthogonal contrasts.
I did something along these lines:

fac <- factor(c("M","F","M","M","F"))     # A categorical predictor.
contrasts(fac)                                          # Default numerical
values used by Anova(), anova(), lm(), aov(), etc.
contrasts(fac) <- "contr.sum"              # Orthogonal contrasts to apply
to "fac".
facCont <- contrasts(fac)[fac]              # Assign values in new variable.
Replace "fac" with "facCont" in model.

Of course, this may have nothing to do with the reason your model was

View this message in context: http://r.789695.n4.nabble.com/about-error-while-using-anova-function-tp4159463p4353590.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list