drop_multicollin | R Documentation |
Drops multicollinear columns in order of highest correlation
drop_multicollin(allx, printprogress = TRUE)
allx |
a matrix of data to check for multicollinearity |
printprogress |
logical to indicate if progress should be printed out to command line |
allx_noMC |
resulting data matrix of full rank after multicolliear columns have been dropped |
dropped_cols |
column names of those dropped |
# make data with multicollinearity
data <- data.frame(x = rnorm(100),
y = sample.int(100,100),
z = runif(100, 3,6))
test = data.frame(mc_1 = data$x,
mc_2 = data$x*2 + data$y - data$z)
dat = cbind(test, data)
#run
mc_check= drop_multicollin(dat)
mc_check$dropped_cols
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.