From mark_difford at yahoo.co.uk  Sat Jul 12 08:22:01 2008
From: mark_difford at yahoo.co.uk (Mark Difford)
Date: Fri, 11 Jul 2008 23:22:01 -0700 (PDT)
Subject: [Rd] matching predictors and dummies
In-Reply-To: <18410832.post@talk.nabble.com>
References: <18405023.post@talk.nabble.com>
	<Pine.LNX.4.64.0807110915480.14412@tajo.ucsd.edu>
	<18410832.post@talk.nabble.com>
Message-ID: <18416554.post@talk.nabble.com>


Hi Jeroen,

>> How could i use the model$terms to extract which coefficients belong to
>> which factor, 
>> the way anova() does it?

There may be a simpler ("canned") way to do it, but why don't you debug
anova.lm to see how it does it?

##
methods("anova")
anova.lm

HTH, Mark.


Jeroen Ooms wrote:
> 
> 
> Charles C. Berry wrote:
>> 
>> See
>>  	?terms
>>  	?terms.object
>> 
>> 
>> 
> 
> 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?
> 
> 

-- 
View this message in context: http://www.nabble.com/matching-predictors-and-dummies-tp18405023p18416554.html
Sent from the R devel mailing list archive at Nabble.com.



[Rd] matching predictors and dummies
Mark Difford