Learn R Programming

rvif (version 3.0)

rvifs: RVIF calculation

Description

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)

Value

RVIF

Redefined Variance Inflation Factor of each independent variable.

%

Percentage of near multicollinearity due to each independent variable.

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.

Author

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

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.

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.

Examples

Run this code
### 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)
	
### Example 2
### The special case of the simple linear regression model
	
	head(SLM1, n=5)
	x = SLM1[,2:3]
	rvifs(x)
	
### 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
	rvifs(x[,-1], intercept = FALSE) # removing the constant from the design matrix
	
### Example 4
### Cases of perfect multicollinearity or computationally singular systems
	
	head(soil, n=5)
	x = soil[,-16]
	rvifs(x)

Run the code above in your browser using DataLab