getX: Model Matrix for a Fit, Possibly on a New Data Frame

Description Usage Arguments Details Value

Description

This function returns the X matrix for a fit, possibly based on a different data frame than the model. It performs a function very close to that of model.matrix except that model.matrix expects the variable for the LHS of the formula to be in the data set, ostensibly in order to remove rows for which the LHS variable(s) are NA. In addition, getX attaches the argument data set as an attribute.

Usage

1
getX(fit, data = getData(fit))

Arguments

fit

a fitted object with formula method

data

(default NULL) a data frame on which to evaluate the model matrix

Details

Extending getX to new classes merely requires a getData method. The formula method is also used but usually already exists.

Value

a design matrix


carEx documentation built on June 28, 2019, 3:01 p.m.