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

View source: R/wald.R

getXR Documentation

Design matrix for a fit possibly on a new data frame

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

getX(fit, data = getModelData(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/spida2 documentation built on Aug. 11, 2024, 7:52 p.m.