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.

        -thomas

______________________________________________
[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