> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Lumley
> Sent: Wednesday, April 07, 2004 5:44 PM
> To: Giovanni Petris

> On Wed, 7 Apr 2004, Giovanni Petris wrote:
> 
> >
> > Hello,
> >
> > After reading the help for predict.lm and predict.glm, it 
> is not clear 
> > to me what are the values returned by predict( ..., type="terms").
> >
> > Anybody willing to enlighten me?
> >
> 
> For each term in the formula, extract its coefficients and 
> the corresponding columns of the design matrix, and multiply 
> the two, and then center the result.
> 
> So, looking at the example in example(termplot) we have a 
> model y~ns(x,6)+z where z is a factor with 4 levels.
> 
> There are 9 coefficients in the model, but only two terms: 
> ns(x,6) (based on 5 coefficients) and z (based on 3 coefficients).
> 
> Adding up the terms and the centering value (also returned by
> predict(,type="terms")) gives the linear predictor.

1) It would be useful to have this in the help file for predict.(g)lm
   Also that the constant is accessed as attr( pr.obj, "const" )

2) A link to termplot might be useful too.

3) I guess that Giovanni (as well as I) was curious what the rationale
behind
   the centering of effects is. Can anyone tell us?

Bendix Carstensen

----------------------
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2
DK-2820 Gentofte
Denmark
tel: +45 44 43 87 38
mob: +45 30 75 87 38
fax: +45 44 43 07 06
[EMAIL PROTECTED]
www.biostat.ku.dk/~bxc

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to