View source: R/lm_betaselect.R
std_data | R Documentation |
Standardize selected variables in a data frame or similar object.
std_data(data, to_standardize)
data |
A data frame or similar object. |
to_standardize |
A character vector of the column names of variables to be standardized. |
This is a helper functions
to be used by lm_betaselect()
and glm_betaselect()
. It
assumes that the variables selected
has been checked whether they are
numeric.
A data frame similar to data
,
with selected variables standardized.
Shu Fai Cheung https://orcid.org/0000-0002-9871-9448
data(data_test_mod_cat)
dat <- data_test_mod_cat
dat <- std_data(dat, to_standardize = c("iv", "dv"))
colMeans(dat[, c("dv", "iv")])
apply(dat[, c("dv", "iv")], 2, sd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.