Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

model.frame.bamlss

BAMLSS Model Frame


Description

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

Usage

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

## S3 method for class '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

Examples

## 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))

## End(Not run)

bamlss

Bayesian Additive Models for Location, Scale, and Shape (and Beyond)

v1.1-3
GPL-2 | GPL-3
Authors
Nikolaus Umlauf [aut, cre] (<https://orcid.org/0000-0003-2160-9803>), Nadja Klein [aut] (<https://orcid.org/0000-0002-5072-5347>), Achim Zeileis [aut] (<https://orcid.org/0000-0003-0918-3766>), Meike Koehler [ctb], Thorsten Simon [aut] (<https://orcid.org/0000-0002-3778-7738>), Stanislaus Stadlmann [ctb]
Initial release
2021-01-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.