Description Usage Arguments Details Value References Examples
Standardize a Vector
1 2 3 | standardize2(x, scale = TRUE)
standardize(x, scale = TRUE)
|
x |
numeric vector |
scale |
scale variable by (twice) its standard deviation? |
standardize centers values and scales them by their standard deviation. standardize2 does the same but scales by twice their standard deviation.
standardized vector.
Gelman, A. (2008). Scaling Regression Inputs by Dividing by two Standard Deviations. Statistics in Medicine 27(2865–2873).
1 2 3 4 5 6 | x <- runif(100, 0, 1.2)
xz <- standardize2(x)
sd(xz)
xz <- standardize(x)
sd(xz)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.