[R] Factors attribute?

Marc Schwartz marc_schwartz at me.com
Mon Mar 22 19:25:50 CET 2010


Kevin,

See ?terms.object, which is indicated in the Value section of ?terms and listed in the See Also of ?terms.

HTH,

Marc Schwartz

On Mar 22, 2010, at 1:16 PM, rkevinburton at charter.net wrote:

> 
> I am sorry but I didn't see "factors" mentioned in this documentation.
> 
> Kevin
> 
> ---- Henrique Dallazuanna <wwwhsd at gmail.com> wrote: 
>> See ?terms
>> 
>> On Mon, Mar 22, 2010 at 2:08 PM,  <rkevinburton at charter.net> wrote:
>>> 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