powered by
This function scales a covariate to have a mean of zero and standard deviation of 0.5.
rescale_continuous(x)
A numeric vector, matrix, or data frame with rescaled covariates having mean of zero and standard deviation of 0.5.
A numeric vector, matrix, or data frame
vec <- rnorm(5, 100, 20) rescale_continuous(vec) mat <- matrix(rnorm(5*5, 100, 20), ncol = 5) rescale_continuous(mat)
Run the code above in your browser using DataLab