# NOT RUN {
## Hald Cement data
data(Hald)
model <- lm(y~X1+X2+X3+X4, data = as.data.frame(Hald))
## Overall diagnostic measures and eigenvalues with intercept term
mctest(model)
## Overall diagnostic measures and eigenvalues without intercept term
mctest(model, Inter=FALSE)
## all individual diagnostic measures
mctest(model, type="i")
## certain individual diagnostic measures with collinearity detection indication
VIF<-mctest(model, type="i", method="VIF")
VIF[[1]][,1] # named VIF values only
IND1<-mctest(model, type="i", method="IND1")
IND1[[1]][,1] # named IND1 values only
## all individual diagnostic measures with correlation matrix
mctest(model, type="i", corr=TRUE)
## VIF and correlation matrix with collinearity detection indication
mctest(model, type="i", method="VIF", corr=TRUE)
## both overall and individual collinearity diagnostics
mctest(model, type="b")
mctest(model, type="b", method="VIF", cor=TRUE)
## all overall and vif with correlation matrix
## VIF and CN desired threshold
## eigenvalues without intercept term
mctest(model, type="b", method="VIF", Inter=FALSE, vif=15, cn=35)
## Individual collinearity diagnostic measures in matrix of 0 or 1
mctest(model, all = TRUE)
mctest(model, method = "VIF", all = TRUE)
mctest(model, type="b", all = TRUE)
# }
Run the code above in your browser using DataLab