Description Usage Arguments Details Value Examples
impact_code
transforms a categorical variable into a continuous one
using Impact Coding described in this
paper.
1 | impact_code(.data, formula, binary = T)
|
.data |
the data frame the data is contained in |
formula |
a formula specifying the dependent and independent variables to use |
binary |
is the dependent variable a binary variable? Logical value |
Missing values in the categorical variable will be treated as another level.
If you want to ignore missing values you will need to do so prior to calling
impact_code
.
a data frame that includes the levels of the categorical variable and the smoothed estimate of the dependent variable.
1 2 | impact_code(mtcars, am ~ cyl)
impact_code(iris, Petal.Width ~ Species, binary = F)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.