head(soil, n=5)
y = soil[,16]
x = soil[,-16]
x = cbind(rep(1, length(y)), x) # the design matrix has to have the intercept in the first column
multicollinearity(y, x)
multicollinearity(y, x[,-3]) # eliminating the problematic variable (SumCation)
Run the code above in your browser using DataLab