mctest (version 1.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), Farrar F-test for determination of multicollinearity, Auxiliary F-test for relationship between F and R-square, Leamer's method, Corrected VIF (CVIF), and Klein's rule.

Usage

imcdiag(x, y, method = NULL, na.rm = TRUE, corr = FALSE, vif=10, tol=0.1,
              conf=0.95, cvif=10, leamer=0.1, all=FALSE, ...)

Arguments

x

A numeric design matrix and should contain more than one regressor.

y

A numeric vector of response variable.

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.

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:

idiags

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

x

A numeric matrix of regressors.

y

A vector of response variable.

method

Specific individual collinearity measure, such as VIF, TOL, and CVIF 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 and CVIF. 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, 1991. 4(1): 33--50.

Chatterjee, S. and A. Hadi, Regression Analysis by Example. 4 ed. 2006, Hoboken, New York; John Wiley and Sons Inc.

Belsley, David. A., Edwin. Kuh, and Roy. E. Welsch. 1980. Regression Diagnostics: Identifying Influential Data and Sources of Collinearity. New York: John Wiley and Sons.

Greene, William H. 2000. Econometric Analysis. 4th Ed. Upper Saddle River, NJ: Prentice--Hall.

Imdadullah, M. Addressing Linear Regression Models with Correlated Regressors: Some Package Development in R, Submitted Ph.D thesis, Department of Statistics, Bahauddin Zakariya University, Multan, Pakistan.

See Also

omcdiag

Examples

Run this code
# NOT RUN {
## Hald Cement data
data(Hald)
x<-Hald[,-1]
y<-Hald[,1]

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

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

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

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

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

Run the code above in your browser using DataLab