[R] need help on GAM

2004-10-12 Thread Liu Song

Get some question about the function gam.
Suppose I have a semiparametric model,
Y~x1+x2+s(z1).
Using gam, how could I get the estimates for the parametric part and 
nonparametric part respectively?

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 
functions?
 
Thank you!

Song

Song Liu
School of Statistics
313 FordH
224 Church St. SE
Minneapolis,MN 55455

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


Re: [R] need help on GAM

2004-10-12 Thread Prof Brian Ripley
Please read the posting guide and do give sufficient details for your 
questions to be answered.

On Tue, 12 Oct 2004, Liu Song wrote:

 Get some question about the function gam.

There are at least two functions gam() available for R, but none in
standard R.  Which package are you talking about?  This is covered in the
R FAQ, BTW.

 Suppose I have a semiparametric model,
 Y~x1+x2+s(z1).
 Using gam, how could I get the estimates for the parametric part and 
 nonparametric part respectively?

What do you mean by those terms?  In the gam() in package gam, s(z1) is 
split into a linear and non-linear part, but all the terms *are* 
parametric (a smoothing spline is a parametric function of its argument).

 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 
 functions?

By definition, non-parametric terms do not have parameters aka 
coefficients.

I suggest you ask for local advice on the statistical background to your 
questions, which you do need to understand before getting to using them in 
R.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [R] need help on GAM

2004-10-12 Thread Gabor Grothendieck
Prof Brian Ripley ripley at stats.ox.ac.uk writes:
:  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 
:  functions?
: 
: By definition, non-parametric terms do not have parameters aka 
: coefficients.

This is definitely a candidate for the fortunes package.

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


Re: [R] need help on GAM

2004-10-12 Thread Simon Wood

 Get some question about the function gam.
 Suppose I have a semiparametric model,
 Y~x1+x2+s(z1).
 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 
 functions?
For mgcv gam objects the coefficients of the smooths are indeed the 
coefficients of the basis functions of the smooths.

best,
Simon

_
 Simon Wood [EMAIL PROTECTED]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

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