model.matrix.gam: Extract model matrix from GAM fit

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Obtains the model matrix from a fitted gam object.

Usage

1
2
## S3 method for class 'gam'
model.matrix(object, ...)

Arguments

object

fitted model object of class gam as produced by gam().

...

other arguments, passed to predict.gam.

Details

Calls predict.gam with no newdata argument and type="lpmatrix" in order to obtain the model matrix of object.

Value

A model matrix.

Author(s)

Simon N. Wood simon.wood@r-project.org

References

Wood S.N. (2006b) Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC Press.

See Also

gam

Examples

1
2
3
4
5
6
7
 
require(mgcv)
n <- 15
x <- runif(n)
y <- sin(x*2*pi) + rnorm(n)*.2
mod <- gam(y~s(x,bs="cc",k=6),knots=list(x=seq(0,1,length=6)))
model.matrix(mod)


Search within the mgcv package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.