smooth2random: Convert a smooth to a form suitable for estimating as random effect
Description
A generic function for converting mgcv smooth objects to forms suitable for estimation as random effects by e.g. lme. Exported mostly for use by other package developers.
Usage
smooth2random(object,vnames,type=1)
Arguments
object
an mgcv smooth object.
vnames
a vector of names to avoid as dummy variable names in the random effects form.
type
1 for lme, otherwise lmer.
Value
Details
There is a duality between smooths and random effects which means that smooths can be estimated using mixed modelling software. This function converts standard mgcv smooth objects to forms suitable for estimation by lme, for example. A service routine for gamm exported for use by package developers.
References
Wood S.N. (2006) Generalized Additive Models: An Introduction with R. Chapman
and Hall/CRC Press.