Description Usage Arguments Value Examples
categorize a set of variables automatically into dummy variables. Return data frame with categorized values. The method could only be reference coding or cell means coding.Score coding is not integrated in this function. The main usage for this function is usesd internally in mylm function. But user could also use this to create categorical variables as well.
1 | categorize(data, vars, method = c("reference", "cellmeans"), ref = c())
|
data |
input data frame with no NAs, should include all the covariates that will be used later |
vars |
name vector for the category variables |
method |
specify the method for categorization |
ref |
specify the reference level for each categorical variable |
data frame with all the category variables transformed to numerous dummy variables.
1 2 3 | data(mydata)
categorize(mydata, c('R_E', 'NIHSS_4Cat'), ref = c(0,1))
categorize(mydata, c('R_E', 'NIHSS_4Cat'), method = 'cellmeans')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.