powered by
This function rescales a covariate to have a mean of zero and range (maximum - minimum) of one
rescale_binary(x)
A numeric vector, matrix, or data frame with rescaled covariates having mean of zero and range (maximum - minimum) of one.
A numeric vector, matrix, or data frame
vec <- c(1, 3, 1, 3, 1) rescale_binary(vec) mat <- matrix(c(1, 3, 1, 3, 1), nrow = 5, ncol = 5) rescale_binary(mat)
Run the code above in your browser using DataLab