View source: R/design_matrix.R
design_matrix | R Documentation |
An internal, convenience function that automatically transforms a vector, matrix, or data.frame with factors into a design matrix with indicator variables and an ommitted category. This is handy for using the SuperLearner and tmle packages
design_matrix(W)
W |
A vector, matrix, or data.frame that includes numeric or factor variables. |
The design_matrix
function is used by agecurveAb
and tmleAb
as a data processing tool for functions that do not readily accommodate factor variables in a data.frame object. In particular, the SuperLearner()
and tmle()
functions typically have difficulty with factor variables and so this function transforms data before calling those functions.
A design matrix version of W
where factor variables have been converted into columns of indicator variables with the first level excluded.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.