model.matrix.bamlss.frame | R Documentation |
The function creates design (or model) matrices for BAMLSS, i.e., for
each parameter of a bamlss.family
object.
## S3 method for class 'bamlss.frame'
model.matrix(object, data = NULL, model = NULL,
drop = TRUE, scale.x = FALSE, ...)
## S3 method for class 'bamlss.formula'
model.matrix(object, data = NULL, model = NULL,
drop = TRUE, scale.x = FALSE, ...)
## S3 method for class 'bamlss.terms'
model.matrix(object, data = NULL, model = NULL,
drop = TRUE, scale.x = FALSE, ...)
object |
A |
data |
A data frame or list. |
model |
Character or integer, specifies the model for which design matrices should be returned. |
drop |
If model matrices for only one |
scale.x |
Logical, should the model matrices of the linear parts be scaled? |
... |
Not used. |
Depending on the type of model a named list of model matrices or a single model matrix.
model.matrix
, bamlss.frame
,
bamlss.formula
, terms.bamlss
.
## Generate some data.
d <- GAMart()
## Model formula.
f <- list(
num ~ x1 + x2 + id,
sigma ~ x3 + fac + lon + lat
)
## Create a "bamlss.frame".
bf <- bamlss.frame(f, data = d)
## Get the model matrices.
X <- model.matrix(bf)
head(X$sigma)
## Same with "bamlss.formula".
X <- model.matrix(bamlss.formula(f), data = d)
head(X$sigma)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.