design_matrix: Convert a vector, matrix or data frame with factors into a...

Description Usage Arguments Details Value

Description

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.

Usage

1

Arguments

W

A vector, matrix, or data.frame that includes numeric or factor variables.

Details

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.

Value

A design matrix version of W where factor variables have been converted into columns of indicator variables with the first level excluded.


ben-arnold/tmleAb documentation built on May 12, 2019, 10:55 a.m.