[R] Factors attribute?

rkevinburton at charter.net rkevinburton at charter.net
Mon Mar 22 18:08:10 CET 2010


I noticed that when I fit a linear model using 'lm' there is an attribute called "factors" that is added to the "term". It doesn't seem to appear for 'model.matrix', just 'lm'. I have been unable to find where it gets constructed or what it means? It looks like a two dimensional array that I may be able to use so I would just like to get some 'official' statement regarding what it is and how it is constructed. I would rather not go on my assumptions. An example would be like:

> l <- lm(prestige ~ income + education, data=Duncan)
> attr(l$terms,"factors")
          income education
prestige       0         0
income         1         0
education      0         1

Thank you.

Kevin Burton
rkevinburton at charter.net



More information about the R-help mailing list