Skip to contents

This function provides the values of the Redefined Variance Inflation Factor (RVIF) and the the percentage of near multicollinearity due to each independent variable.

Usage

rvifs(x, ul = TRUE, intercept = TRUE, tol = 1e-30)

Arguments

x

A numerical design matrix that should contain more than one regressor. If it has an intercept, this must be in the first column of the matrix).

ul

A logical value that indicates if the variables in the design matrix x are transformed to unit length. By default ul=TRUE.

intercept

A logical value that indicates if the design matrix x has an intercept. By default intercept=TRUE.

tol

Value determining whether the system is computationally singular. By default tol=1e-30.

Details

The Redefined Variation Inflation Factor (RVIF) is capable to detect both kind of multicollinearity: the essential (approximate linear relationship between at least two independent variables excluding the intercept) and non-essential (approximate linear relationship between the intercept and at least one of the remaining independent variables). This measure also quantifies the percentage of near multicollinearity due to each independent variable.

Value

RVIF

Redefined Variance Inflation Factor of each independent variable.

%

Percentage of near multicollinearity due to each independent variable.

References

R. Salmerón, C. García, and J. García. (2018). Variance inflation factor and condition number in multiple linear regression. Journal of Statistical Computation and Simulation, 88:2365-2384, doi: https://doi.org/10.1080/00949655.2018.1463376.

Salmerón, R., Rodríguez, A. and García, C.B. (2020). Diagnosis and quantification of the non-essential collinearity. Computational Statistics, 35(2), 647-666, doi: https://doi.org/10.1007/s00180-019-00922-x.

Salmerón, R., García, C.B. y García, J. (2025). A redefined Variance Inflation Factor: overcoming the limitations of the Variance Inflation Factor. Computational Economics, 65, 337-363, doi: https://doi.org/10.1007/s10614-024-10575-8.

Author

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

Examples

### Example 1
  
  library(multiColl)
  set.seed(2025)
  obs = 100
  cte = rep(1, obs)
  x2 = rnorm(obs, 5, 0.01)
  x3 = rnorm(obs, 5, 10)
  x4 = x3 + rnorm(obs, 5, 1)
  x5 = rnorm(obs, -1, 30)
  x = cbind(cte, x2, x3, x4, x5)
  rvifs(x)
#>                    RVIF       %
#> Intercept  2.495289e+05 99.9996
#> Variable 2 2.487886e+05 99.9996
#> Variable 3 1.282689e+02 99.2204
#> Variable 4 2.088057e+02 99.5211
#> Variable 5 1.034727e+00  3.3561
  
### Example 2
### The special case of the simple linear regression model
  
  head(SLM1, n=5)
#>           y1 cte         V
#> 1  82.392059   1 19.001420
#> 2  -1.942157   1 -1.733458
#> 3   7.474090   1  1.025146
#> 4 -12.303381   1 -4.445014
#> 5  30.378203   1  6.689864
  x = SLM1[,2:3]
  rvifs(x)
#>                RVIF       %
#> Intercept  2.015249 50.3783
#> Variable 2 2.015249 50.3783
  
### Example 3
### The intercept must be in the first column of the design matrix
  
  set.seed(2025)
  obs = 100
  cte = rep(1, obs)
  x2 = sample(1:500, obs)
  x3 = sample(1:500, obs)
  x4 = rep(4, obs)
  x = cbind(cte, x2, x3, x4)
  rvifs(x) # also: perfect multicollinearity between the intercept and the constant variable
#> There is a constant variable. Delete it before running the code or, if it is the intercept, it must be the first column of the design matrix.
#> Perfect multicollinearity exists. Modify the design matrix before running the code.
  rvifs(x[,-1], intercept = FALSE) # removing the constant from the design matrix
#> There is a constant variable. Delete it before running the code or, if it is the intercept, it must be the first column of the design matrix.
  
### Example 4
### Cases of perfect multicollinearity or computationally singular systems
  
  head(soil, n=5)
#>   BaseSat SumCation CECbuffer     Ca     Mg      K    Na     P    Cu    Zn
#> 1    2.34    0.1576     0.614 0.0892 0.0328 0.0256 0.010 0.000 0.080 0.184
#> 2    1.64    0.0970     0.516 0.0454 0.0218 0.0198 0.010 0.000 0.064 0.112
#> 3    5.20    0.4520     0.828 0.3306 0.0758 0.0336 0.012 0.240 0.136 0.350
#> 4    4.10    0.3054     0.698 0.2118 0.0536 0.0260 0.014 0.030 0.126 0.364
#> 5    2.70    0.2476     0.858 0.1568 0.0444 0.0304 0.016 0.384 0.078 0.376
#>      Mn HumicMatter Density    pH ExchAc Diversity
#> 1 3.200      0.1220  0.0822 0.516  0.466 0.2765957
#> 2 2.734      0.0952  0.0850 0.512  0.430 0.2613982
#> 3 4.148      0.1822  0.0746 0.554  0.388 0.2553191
#> 4 3.728      0.1646  0.0756 0.546  0.408 0.2401216
#> 5 4.756      0.2472  0.0692 0.450  0.624 0.1884498
  x = soil[,-16]
  rvifs(x)
#> System is computationally singular. Modify the design matrix before running the code.