Learn R Programming

MachineShop (version 2.8.0)

ModelFrame: ModelFrame Class

Description

Class for storing data, formulas, and other attributes for MachineShop model fitting.

Usage

ModelFrame(x, ...)

# S3 method for formula ModelFrame(x, data, na.rm = TRUE, weights = NULL, strata = NULL, ...)

# S3 method for matrix ModelFrame( x, y = NULL, na.rm = TRUE, offsets = NULL, weights = NULL, strata = NULL, ... )

Arguments

x

model formula or matrix of predictor variables.

...

arguments passed to other methods.

data

data frame or an object that can be converted to one.

na.rm

logical indicating whether to remove cases with NA values for any of the model variables.

weights

vector of case weights [default: equal].

strata

vector of resampling stratification levels [default: none].

y

response variable.

offsets

numeric vector, matrix, or data frame of values to be added with a fixed coefficient of 1 to linear predictors in compatible regression models.

Value

ModelFrame class object that inherits from data.frame.

See Also

fit, resample, response, SelectedInput

Examples

Run this code
# NOT RUN {
## Requires prior installation of suggested package gbm to run

mf <- ModelFrame(ncases / (ncases + ncontrols) ~ agegp + tobgp + alcgp,
                 data = esoph, weights = with(esoph, ncases + ncontrols))
gbm_fit <- fit(mf, model = GBMModel)
varimp(gbm_fit)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab