Description Usage Arguments Value Author(s) Examples
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
1 | varRegressors(Data, VarName, RegressorNames = NULL)
|
Data |
The dataframe to add regressors |
VarName |
Character string name of variable to code regressor for |
RegressorNames |
Optional variable names for regressors. |
Returns original data frame (Data) with addition of new regressors.
John J. Curtin jjcurtin@wisc.edu
1 2 3 4 | ##NOT RUN
##data(BAC)
##BAC$Sex = factor(BAC$Sex)
##BAC = varRegressors(BAC,'Sex')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.