bamlss (version 0.1-1)

model.frame.bamlss:

Description

Extracts the model frame of a bamlss or bamlss.frame object.

Usage

# S3 method for bamlss
model.frame(formula, ...)

# S3 method for bamlss.frame model.frame(formula, ...)

## Internal helper function for creating ## the model frame. bamlss.model.frame(formula, data, family = gaussian_bamlss(), weights = NULL, subset = NULL, offset = NULL, na.action = na.omit, specials = NULL, contrasts.arg = NULL, drop.unused.levels = TRUE, ...)

Arguments

formula
An object of class "bamlss" or "bamlss.frame".
data
A data.frame or list containing the model response variable(s) and covariates specified in the formula. By default the variables are taken from environment(formula).
family
A bamlss.family object, see function bamlss.
weights
Prior weights on the data.
subset
An optional vector specifying a subset of observations to be used in the fitting process.
offset
Can be used to supply model offsets for use in fitting.
na.action
A function which indicates what should happen when the data contain NA's. The default is set by the na.action setting of options, and is na.omit if set to NULL.
specials
Special function in formulas, see terms.object.
contrasts.arg
An optional list. See the contrasts.arg of model.matrix.default.
drop.unused.levels
Should factors have unused levels dropped?
Arguments to be passed to bamlss.model.frame() and others.

Value

The data.frame containing the variables used for modeling with function bamlss.

See Also

bamlss, bamlss.frame, model.matrix.bamlss.frame.

Examples

Run this code
## Not run: ------------------------------------
# ## Generate some data.
# d <- GAMart()
# 
# ## Model formula.
# f <- list(
#   log(pnum) ~ s(x1) + log(x2),
#   sigma ~ s(x3)
# )
# 
# ## Estimate model.
# b <- bamlss(f, data = d)
# 
# ## Extract the model frame.
# head(model.frame(b))
## ---------------------------------------------

Run the code above in your browser using DataCamp Workspace