model_data: Model data getter

View source: R/object_specific.R

model_dataR Documentation

Model data getter

Description

Get the data with which the distributional regression model of interest was estimated (see distreg_checker for a list of supported object classes). By default, only explanatory variables are returned.

Usage

model_data(model, dep = FALSE, varname = NULL, incl_dep = FALSE)

Arguments

model

A gamlss or bamlss object.

dep

If TRUE, then only the dependent variable is returned.

varname

Variable name in character form that should be returned. If this is specified, only the desired variable is returned.

incl_dep

Should the dependent variable be included?

Value

A data.frame object if dep or varname is not specified, otherwise a vector.

Examples

library("betareg")

# Get some data
beta_dat <- model_fam_data(fam_name = "betareg")

# Estimate model
betamod <- betareg(betareg ~ ., data = beta_dat)

# Get data
model_data(betamod)

Stan125/distreg.vis documentation built on Oct. 31, 2023, 2:40 p.m.