varRegressors: Adds actual numeric regressors for factor to dataframe as new...

Description Usage Arguments Value Author(s) Examples

Description

Adds new variables/columns in dataframe to represent numeric regressors for a factor. Factors are coded using their currently defined contrast codes. This function is useful for control of a factor covariate when graphing and ignoring this factor and/or other lower-level control variables. For this purpose, POC coding will typically be set for factor prior to using lm.codeRegressor

Usage

1
varRegressors(Data, VarName, RegressorNames = NULL)

Arguments

Data

The dataframe to add regressors

VarName

Character string name of variable to code regressor for

RegressorNames

Optional variable names for regressors.

Value

Returns original data frame (Data) with addition of new regressors.

Author(s)

John J. Curtin jjcurtin@wisc.edu

Examples

1
2
3
4
##NOT RUN
##data(BAC)
##BAC$Sex = factor(BAC$Sex)
##BAC = varRegressors(BAC,'Sex')

lmSupport documentation built on May 2, 2019, 2:14 p.m.