Learn R Programming

mctest (version 1.3.1)

imcdiag: Individual Multicollinearity Diagnostic Measures

Description

Computes different measures of multicollinearity diagnostics for each regressor in the design matrix \(X\). Individual measures includes variance Inflation factor (VIF) (Marquardt, 1970), Farrar F-test for determination of multicollinearity (Farrar and Glauber, 1967), Auxiliary F-test for relationship between F and R-square(Gujarati and Porter, 2008), Leamer's method (Greene, 2002), Corrected VIF (CVIF) Curto and Pinto (2011) <doi: 10.1080/02664763.2010.505956>, Klein's rule Klein (1962), and IND1 & IND2 (Imdad, et. al., 2019) <https://doi.org/10.17576/jsm-2019-4809-26> proposed by the researchers.

Usage

imcdiag(mod, method = NULL, na.rm = TRUE, corr = FALSE, 
              vif = 10, tol = 0.1, conf = 0.95, cvif = 10, ind1 = 0.02, 
              ind2 = 0.7, leamer = 0.1, all = FALSE, ...)

Arguments

mod

A model object, not necessarily type lm

na.rm

Whether to remove missing observations.

method

Specific individual measure of collinearity such as VIF, CVIF, and Leamer, etc. For example, method="VIF".

corr

Whether to display correlation matrix or not, by default corr=FALSE.

vif

Default threshold for VIF measure, vif=10.

tol

Default threshold for TOL measure, tol=0.10.

conf

Default confidence level for Farrar's Wi test, conf=0.99.

cvif

Default threshold for CVIF measure, CVIF=10.

ind1

Default threshold for IND1 indicator, ind1=0.02

ind2

Default threshold for IND2 indicator, ind2=0.7

leamer

Default threshold for Leamer's method, leamer=0.1.

all

Returns all individual measure of collinearity in a matrix of 0 (not detected) or 1 (detected).

...

Extra argument(s) if used will be ignored.

Value

This function detects the existence of multicollinearity by using different available diagnostic measures already available in literature. The function returns the value of diagnostic measures with decision of either collinearity is detected by the diagnostic measure or not. Value of 1 indicates that collinearity is detected and 0 indicates that measure could not detect the existence of collinearity. A list object of class "imc" is returned:

x

A numeric matrix of regressors.

y

A vector of response variable.

idiags

Listing of specific individual measure such as method="CVIF" provided. If method is not used all individual diagnostics will be displayed.

method

Specific individual collinearity measure, such as VIF, TOL, CVIF, IND1, and IND2 etc.

corr

Logical, if FALSE (the default value) a correlation matrix will not be displayed.

R2

R-square from regression of all regressors \(X\) on response variable \(y\).

call

The matched call.

pval

Returns significant regressor as number after comparing the p-value of regressors from summary.lm function with \(1-conf\).

all

If TRUE individual collinearity measures will be returned as a matrix of 0 or 1.

alldiag

Matrix of all individual collinearity measures indicated as either 0 (collinearity not detected) or 1 (collinearity detected) for each diagnostic measure and each regressor.

Details

The imcdiag function detects the existence of multicollinearity due to \(x\)-variable. That's why named as individual measures of diagnostics. This includes VIF, TOL, Klein's rule, Farrar and Glauber F-test, F and \(R^2\) relation, Leamer's method, CVIF, IND1, and IND2 diagnostic measures of multicollinearity. If method argument is used (method="VIF"), the VIF values for each regressor will be displayed with decision of either collinearity exists or not which is indicated by 0 (collinearity is not detected by method for regressor) and 1 (collinearity is detected by the method for regressor). If argument all=TRUE all individual measures of collinearity will be displayed in a matrix of 0 (collinearity is not detected) or 1 (collinearity is detected).

References

Belsely, D. A. A Guide to Using the Collinearity Diagnostics. Computer Science in Economics and Management, 4(1): 33--50, 1991.

Belsley, D. A., Kuh, E., and Welsch, R. E. Regression Diagnostics: Identifying Influential Data and Sources of Collinearity. John Wiley \& Sons, New York, 1980.

Chatterjee, S. and Hadi, A. S. Regression Analysis by Example. John Wiley \& Sons, 4th edition, New York, 2006.

Curto, J. D. and Pinto, J. C. The Corrected VIF (CVIF). Journal of Applied Statistics, 38(7), 1499--1507.

Greene, W. H. Econometric Analysis. Prentice--Hall, Upper Saddle River, New Jersey, 4th edition, 2000.

Imdad, M. U. Addressing Linear Regression Models with Correlated Regressors: Some Package Development in R (Doctoral Thesis, Department of Statistics, Bahauddin Zakariya University, Multan, Pakistan), 2017.

Imdadullah, M., Aslam, M., and Altaf, S. mctest: An R Package for Detection of Collinearity Among Regressors. The R Journal, 8(2):499--509, 2016.

Imdad, M. U., Aslam, M., Altaf, S., and Ahmed, M. Some New Diagnostics of Multicollinearity in Linear Regression Model. Sains Malaysiana, 48(2): 2051--2060, 2019.

See Also

Overall collinearity diagnostic omcdiag, collinearity plot mc.plot

Examples

Run this code
# NOT RUN {
## Hald Cement data
data(Hald)
model <- lm(y~X1+X2+X3+X4, data = as.data.frame(Hald))

## all Individual measures
id<-imcdiag(model); id$idiags[,1]

# VIF measure with custom VIF threshold
imcdiag(model, method = "VIF", vif = 5)

# IND1 measure with custom IND1 threshold and correlation matrix
imcdiag(model, method="IND1", ind1=0.01, corr=TRUE)

# CVIF measure with custom CVIF threshold and correlation matrix
imcdiag(model, method = "CVIF", cvif = 5, corr = TRUE)

# Collinearity Diagnostic measures in matrix of 0 or 1
imcdiag(model, all = TRUE)
imcdiag(model, method = "VIF", all = TRUE)

## only VIF values without collinearity detection indication
imcdiag(model, method = "VIF")[[1]][,1]
plot(imcdiag(model, method = "VIF")[[1]][,1]) # vif plot
# }

Run the code above in your browser using DataLab