View source: R/categorical.handling.R
This function performs categorical variable binarization, which is handled in other libraries but in this case is performed with some particularities. Conditions with fewer than a specified number of subjects are combined into a single meta-group tagged "combined.other", which has undesirable statistical properties but at the very least is less likely to cause your downstream model to just implode.
1 | binarize(df, minimum.factor.level.count, conditions)
|
df |
data.frame, source data frame containing model matrix data to be transformed |
minimum.factor.level.count |
numeric, number of subjects in a condition strictly below which the condition is merged into the catch-all meta group |
conditions |
list of logical vectors. each vector should
be of length |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.