Learn R Programming

sasLM (version 1.0.1)

ModelMatrix: Model Matrix

Description

This model matrix is similar to model.matrix, but it does not omit unnecessary columns.

Usage

ModelMatrix(Formula, Data, KeepOrder=FALSE, XpX=FALSE)

Value

Model matrix and attributes similar to the output of model.matrix.

X

design matrix, i.e. model matrix

XpX

cross-product of the design matrix, X'X

terms

detailed information about terms such as formula and labels

termsIndices

term indices

assign

assignment of columns for each term in order, a different way of expressing term indices

Arguments

Formula

a conventional formula for a linear model

Data

a data.frame to be analyzed

KeepOrder

If KeepOrder is TRUE, the order of terms in Formula will be kept. This is for Type I SS.

XpX

If XpX is TRUE, the cross-product of the design matrix (XpX, X'X) will be returned instead of the design matrix (X).

Author

Kyun-Seop Bae k@acr.kr

Details

It makes the model (design) matrix for GLM.