mctest (version 1.1)

mctest: Multicollinearity diagnostic measures

Description

The function mctest display overall, individual or both types of multicollinearity diagnostic measures from omcdiag and imcdiag functions respectively.

Usage

mctest(x, y, type=c("o","i","b"), na.rm = TRUE, Inter=TRUE, method=NULL,
        corr=FALSE, detr=0.01, red=0.5, theil=0.5, cn=30, 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.

Inter

Whether to include or exclude Intercept term. By default Inter=TRUE.

type

Displays overall, individual or both type of collinearity diagnostics. Overall collinearity diagnostics are displayed by default with eigenvalues and condition indexes, when method and type argument are not used.

method

Specific individual measure of collinearity such as VIF, TOL, CVIF, and Leamer, etc, when method argument is used. For example, method="VIF".

corr

Whether to display correlation matrix or not Inter=TRUE.

detr

Determinant default threshold, detr=0.01.

red

Red indicator default threshold, red=0.5.

theil

Theil's indicator default threshold, theil=0.5.

cn

Condition number default threshold, cn=30.

vif

Default threshold for VIF measure, vif=10.

conf

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

cvif

Default threshold for CVIF measure, CVIF=10.

tol

Default threshold for TOL measure, TOL=0.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.

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 Zakaraiya University, Multan, Pakistan.

See Also

Overall collinearity diagnostic measures omcdiag, Individual collinearity diagnostic measures imcdiag

Examples

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

## Overall diagnostic measures and eigenvalues with intercept term
mctest(x, y)

## Overall diagnostic measures and eigenvalues without intercept term
mctest(x, y, Inter=FALSE)

## all individual diagnostic measures
mctest(x, y, type="i")

## certain individual diagnostic measures with collinearity detection indication
VIF<-mctest(x, y, type="i", method="VIF")
VIF[[1]][,1] # named VIF values only

## all individual diagnostic measures with correlation matrix
mctest(x, y, type="i", corr=TRUE)

## VIF and correlation matrix with collinearity detection indication
mctest(x, y, type="i", method="VIF", corr=TRUE)

## both overall and individual collinearity diagnostics
mctest(x, y, type="b")
mctest(x, y, type="b", method="VIF", cor=TRUE)

## all overall and vif with correlation matrix
## VIF and CN desired threshold
## eigenvalues without intercept term
mctest(x, y, type="b", method="VIF", Inter=FALSE, vif=15, cn=35)

## Individual collinearity diagnostic measures in matrix of 0 or 1
mctest(x, y, all = TRUE)
mctest(x, y, method = "VIF", all = TRUE)
mctest(x, y, type="b", all = TRUE)

# }

Run the code above in your browser using DataCamp Workspace