Skip to content
Prev 274620 / 398506 Next

pdIdent in smoothing regression model

On Sun, 2011-10-09 at 10:25 -0400, Lei Liu wrote:
[whoops - fingers slipped and sent the message prematurely]

I'm not going to try to fix this nor work out how to do it via lme(),
but just wanted to note that you can use mgcv:::gam() for example to fit
something very similar.

require(SemiPar)
require(mgcv)

data(fossil)
mod <- gam(strontium.ratio ~ s(age), data = fossil,
           method = "REML")

That is treating the smoothness terms as random effects.

Also note that Matt Wand wrote the SemiPar package as support software
for the book Semiparametric Regression, where these example data are
taken from:

http://cran.r-project.org/web/packages/SemiPar/index.html

You could use the function contained therein.

The above presumes you weren't wanting to make the example work for some
pedagogic reason.

HTH

G