MTest {MTest} | R Documentation |
MTest
Description
MTest is a nonparametric test based on bootstrap for detecting multicollinearity. This test gives statistical support to two of the most famous methods for detecting multicollinearity in applied work: Klein’s rule and Variance Inflation Factor (VIF for essential multicollinearity).
Usage
MTest(object, nboot = 100,
nsam = NULL,trace = FALSE,seed = NULL,
valor_vif = 0.9)
Arguments
object |
an object representing a model of an appropriate class (mainly "lm"). This is used as the model in MTest. |
nboot |
Numeric; number of bootstrap iterations to obtain the probability distribution of R squared (global and auxiliar). |
nsam |
Numeric; sample size for bootstrap samples. |
trace |
Logical; prints iteration process. |
seed |
Numeric; seed value for the bootstrap in nboot parameter. |
valor_vif |
Numeric; value to be compared in kleins rule. |
Details
MTest generates a bootstrap distribution for the coefficient of determination which lets the researcher assess multicollinearity by setting a statistical significance \alpha
, or more precisely, an achieved significance level (ASL) for a given threshold.
Consider the regression model
Y_i = \beta_0X_{0i} + \beta_1X_{1i} + \cdots+ \beta_pX_{pi} +u_i
where i = 1,...,n
, X_{j,i}
are the predictors with j = 1,...,p
, X_0 = 1
for all i
and u_i
is the gaussian error term.
In order to describe Klein's rule and VIF methods, we need to define auxiliary regressions associated to model. An example of an auxiliary regressions is:
X_{2i} = \gamma_1X_{1i} + \gamma_3X_{3i} + \cdots+ \gamma_pX_{pi} +u_i.
In general, there are p
auxiliary regressions and the dependent variable is omitted in each auxiliary regression. Let R_{g}^{2}
be the coefficient of determination of the model and R_{j}^{2}
the j\text{th}
coefficient of determination of the j\text{th}
auxiliary regression.
Value
Returns an object of class MTest
.
An object of class MTest
is a list containing
at most the following components:
pval_vif |
p values for vif test; |
pval_klein |
p values for klein test; |
Bvals |
A |
vif.tot |
Observed VIF values; |
R.tot |
Observed |
nsam |
sample size used in bootstrap procedure. |
Author(s)
Víctor Morales Oñate, victor.morales@uv.cl, https://sites.google.com/site/moralesonatevictor/,https://www.linkedin.com/in/vmoralesonate/ Bolívar Morales Oñate, bmoralesonate@gmail.com, https://sites.google.com/site/moralesonatevictor/
References
Morales-Oñate, V., and Morales-Oñate, B. (2023). MTest: a Bootstrap Test for Multicollinearity. Revista Politécnica, 51(2), 53–62. doi:10.33333/rp.vol51n2.05
Examples
library(MTest)
data(simDataMTest)
m1 <- lm(y~.,data = simDataMTest)
boot.sol <- MTest(m1,trace=FALSE,seed = 1,nboot = 50)
boot.sol$pval_vif
boot.sol$pval_klein
head(boot.sol$Bvals)
print(boot.sol)