Learn R Programming

rfUtilities (version 1.0-2)

multi.collinear: Multi-collinearity test

Description

Test for multi-collinearity in data using qr-matrix decomposition

Usage

multi.collinear(x, p = 0.0000001)

Arguments

x
data.frame or matrix object
p
multi-collinearity threshold

Value

  • test statistic message names character vector of multi-collinearity variables

References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole. Dongarra, J. J., Bunch, J. R., Moler, C. B. and Stewart, G. W. (1978) LINPACK Users Guide. Philadelphia: SIAM Publications.

Examples

Run this code
test <- data.frame(v1=seq(0.1, 5, length=100), v2=seq(0.1, 5, length=100),
                   v3=dnorm(runif(100)), v4=dnorm(runif(100)))
  ( cl <- multi.collinear(test) )

# PCA biplot of variables
pca.test <- prcomp(test[,1:ncol(test)], scale=TRUE)
  biplot(pca.test, arrow.len=0.1, xlabs=rep(".", length(pca.test$x[,1])))

 # Remove identified variable(s)
 test <- test[,-which(names(test)==cl)]

Run the code above in your browser using DataLab