[R] linear model coefficients
Joerg Schaber
Joerg.Schaber at uv.es
Mon Jul 28 17:36:12 CEST 2003
Hi,
I wonder if there is a possibility to avoid that R sets one level of a
factor equal zero in a model fit.
More precisely, I want to fit a two-way unbalanced linear model: o ~ 0 +
x + y
x is a factor with 10 levels, y is a factor with 9 levels. In order to
get a unique solution
i set the intercept =0 and impose that sum(y)=0 i.e.
res <- lm(o ~ 0 + x + y, contrasts=list(y=("contr.sum")))
However, R keeps returning only 8 coefficients for y. I assume that
internally one coefficient is always set to zero. But when I impose
"contr.sum", setting one coef to zero is no longer really nessasary,
isn't it?
So my questions is, if there is a way yo avoid that, or am I completely
mistaken?
greetings,
joerg
More information about the R-help
mailing list