Skip to content
Prev 29393 / 63424 Next

matching predictors and dummies

Charles C. Berry wrote:
I am sorry but i cannot figure out how i can find out which coefficients
belong to which predictors using the model$terms. If i do
attributes(model$terms) i get a nice list which contains the orriginal
factors and some more information, and from model$xlevels i can see the
levels of these factors. However, it does not say anywhere which of the
model$coefficients belong to which factor. The only thing i can imagine is
assuming that the dummy names are simply the concatenation of the factor
name and the level name, which seems to be the default behavior. But
preferebly i would not want to make my program rely on this assumption. How
could i use the model$terms to extract which coefficients belong to which
factor, the way anova() does it?