getX: Design matrix for a fit possibly on a new data frame

Description Usage Arguments Details Value

Description

This function return 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 design matrix

Details

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

Value

a design matrix


gmonette/yscs documentation built on May 17, 2019, 7:28 a.m.