Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

multiCol

Collinearity detection in a linear regression model


Description

The function collects all existing measures to detect worrying multicollinearity in the package multiCol.

Usage

multiCol(X, dummy = FALSE, pos = NULL)

Arguments

X

A numeric design matrix that should contain more than one regressor (intercept included).

dummy

A logical value that indicates if there are dummy variables in the design matrix X. By default dummy=FALSE.

pos

A numeric vector that indicates the position of the dummy variables, if these exist, in the design matrix X. By default pos=NULL.

Value

If X contains two independent variables (intercept included) see SLM function.

If X contains more than two independent variables (intercept included):

CV

Coeficients of variation of quantitative variables in X.

Prop

Proportion of ones in the dummy variables.

R

Matrix correlation of the quantitative variables in X.

detR

Determinant of the matrix correlation of the quantitative variables in X.

VIF

Variance Inflation Factors of the quantitative variables in X.

CN

Condition Number of X.

ki

Stewart's index of the quantitative variables in X.

Note

For more detail, see the help of the functions in See Also.

Author(s)

R. Salmerón (romansg@ugr.es) and C. García (cbgarcia@ugr.es).

References

L. R. Klein and A.S. Goldberger (1964). An economic model of the United States, 1929-1952. North Holland Publishing Company, Amsterdan.

H. Theil (1971). Principles of Econometrics. John Wiley & Sons, New York.

See Also

Examples

# Henri Theil's textile consumption data modified
data(theil)
head(theil)
cte = array(1,length(theil[,2]))
theil.X = cbind(cte,theil[,-(1:2)])
multiCol(theil.X, TRUE, pos = 4)

# Klein and Goldberger data on consumption and wage income
data(KG)
head(KG)
cte = array(1,length(KG[,1]))
KG.X = cbind(cte,KG[,-1])
multiCol(KG.X)

# random
x1 = array(1,25)
x2 = rnorm(25,100,1)
x = cbind(x1,x2)
head(x)
multiCol(x)

# random
x1 = array(1,25)
x2 = sample(cbind(array(1,25),array(0,25)),25)
x = cbind(x1,x2)
head(x)
multiCol(x, TRUE)

multiColl

Collinearity Detection in a Multiple Linear Regression Model

v1.0
GPL (>= 2)
Authors
R. Salmeron, C.B. Garcia and J. Garcia
Initial release
2019-07-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.