[R] need help on GAM
simon at stats.gla.ac.uk
Tue Oct 12 19:08:03 CEST 2004
> Get some question about the function "gam".
> Suppose I have a semiparametric model,
> Using "gam", how could I get the estimates for the parametric part and
> nonparametric part respectively?
For a gam object (called, b,say) fitted using the mgcv `gam' then coef(b)
will extract the coefficients for both the strictly parametric and smooth
components of the model, labelled appropriately. summary(b) is also
helpful. Often it is most useful to extract estimates of the smooths
evaluated at a specified set of covariate values by using the gam `predict'
method with type="terms".
> And another question: we could find the coefficients for both
> parametric term and nonparametric term, what do these coefficients
> for the nonparametric term stand for, the coefficients for the base
For mgcv gam objects the coefficients of the smooths are indeed the
coefficients of the basis functions of the smooths.
> Simon Wood simon at stats.gla.ac.uk www.stats.gla.ac.uk/~simon/
>> Department of Statistics, University of Glasgow, Glasgow, G12 8QQ
>>> Direct telephone: (0)141 330 4530 Fax: (0)141 330 4814
More information about the R-help