ModelMatrix: Model Matrix

View source: R/ModelMatrix.R

ModelMatrixR Documentation

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)

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.

XpX

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

Details

It makes the model(design) matrix for GLM.

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

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

Author(s)

Kyun-Seop Bae k@acr.kr


sasLM documentation built on Nov. 19, 2023, 5:12 p.m.