model.matrix.scam: Extract model matrix from SCAM fit

View source: R/summary.scam.R View source: R/predict.scam.R

model.matrix.scamR Documentation

Extract model matrix from SCAM fit

Description

Obtains the model matrix from a fitted scam object.

Usage

## S3 method for class 'scam'
model.matrix(object, ...)

Arguments

object

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

...

other arguments, passed to predict.scam.

Details

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

Value

A model matrix.

See Also

scam

Examples

 
require(scam)
set.seed(4)
n <- 200
x <- runif(n)*4-1
y <- exp(4*x)/(1+exp(4*x)) +rnorm(n)*.5
m <- scam(y ~ s(x,bs="mpi"))
X <- model.matrix(m)

scam documentation built on Oct. 17, 2026, 1:07 a.m.