[R] obtaining coefficients from a pspline fit
ripley at stats.ox.ac.uk
Sat Mar 29 08:30:28 CET 2003
1) sm.spline is in package Pspline. It does not fit a regression spline:
use ns/bs in packages splines with lm() to do that. For what you did do,
smooth.spline in package modreg would be preferred.
2) I don't see why you think the coefficients would be useful. You need
to know the knots and the respresentation of the spline too. What do you
want to do with them? For almost all purposes you want to call predict()
on a regression-spline fit.
Coefficients are less useful in linear regression than many people think,
too, but they can often be sent up to have a direct interpretation. That
is never true of spline coefficients.
My advice is that you seek local statistical advice. If you find
something hard to do in R it is usually because no one has wanted to do
it, and that is usually because it is not seen as helpful.
On Fri, 28 Mar 2003, Nirmal Govind wrote:
> Hi.. I'm relatively new to both nonparametric modeling and R.. I'm trying to fit
> a regression spline or a piecewise polynomial using R and have teh following
> 1. How do I fit a regression spline/piecewise polynomial to the data for some
> specified degree of the polynomial?
> 2. How do I obtain the coefficients of the model?
Brian D. Ripley, ripley at stats.ox.ac.uk
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, UK Fax: +44 1865 272595
More information about the R-help