design.matrix: Design Matrix

Description Usage Arguments Details Value Author(s)

Description

Creates a design matrix.

Usage

1
design.matrix(a, name = "X", remove.collinear = TRUE, include.intercept = TRUE)

Arguments

a

Object from which to create a design matrix. Can be a vector, matrix, factor, or dataframe.

name

Name of the design matrix. Used to name columns that aren't already named (e.g. X1, X2, etc.)

remove.collinear

Will remove columns that are collinear, to ensure the design matrix is full rank.

include.intercept

Add an intercept to the matrix if one is not included already.

Details

Numerical vectors are not modified. Factors are converted to dummy variables. Character vectors are converted to factors, and then to dummy variables.

Value

A matrix.

Author(s)

Johann Gagnon-Bartsch johanngb@umich.edu


ruv documentation built on Aug. 31, 2019, 1:04 a.m.