Description Usage Arguments Examples
Standardizes regression input columns to have comparable regression coefficients. Rules are as follows: * categoricals: ignore (leave as dummy vars with 0/1) * binaries: ignore (leave as 0/1) * continuous: divide by 2 std dev. if scale = F; or reset so sd = 1, mean = 0 if center = T, scale = T; divided by root mean squared if scale = T, center = F Based off of Andrew Gelman's suggestions: http://andrewgelman.com/2009/07/11/when_to_standar/
1 |
df |
data frame containing all the data |
center |
binary if the continuous data should be centered (set so mean = 0) |
scale |
binary if the data should be scaled so the new standard deviation is 1 (if centered), or the value divided by the RMS (if not centered). If false, the column will merely be divided by 2 std. dev. |
1 2 3 | scaledcenter_mtcars = center_scale(mtcars)
scaled_mtcars = center_scale(mtcars, center = FALSE)
adj_mtcars = center_scale(mtcars, center = FALSE, scale = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.