Transform all data by subtracting a constant, either the mean, median value, or a submitted constant.
The input may be a vector or a matrix. If a matrix, each column is centered on its mean (median), or by passing a vector of constants. Note that setting by=0 amounts to no change.
1 | center.predictors(x, by = "mean")
|
1 2 3 4 | ## Not run:
center.predictors(x=c(1,4,7,0),by='median')
center.predictors(x=c(1,4,7,0),by=2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.