Learn R Programming

sasLM (version 0.6.0)

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)

Arguments

Formula

a conventional formula for a linear model

Data

a data.frame to be analyzed

KeepOrder

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

Value

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

X

design matrix, i.e. model matrix

terms

detailed information about terms such as formula and labels

termsIndices

term indices

assign

assignemnt of columns for each terms in order, different way of expressing term indices

Details

It makes the model(design) matrix for GLM.