getVIF: Calculates the varience inflation factors.

getVIFR Documentation

Calculates the varience inflation factors.

Description

Calculates the varience inflation factors (VIF) for linear and generalized linear models.

Usage

    getVIF(mod)

Arguments

mod

A lm or glm object.

Details

VIF is a measure of multicolinearity. See https://en.wikipedia.org/wiki/Variance_inflation_factor for more details.

This function is a slight modificaton of the vif function in the car package. It has been included here to (a) reduce external dependancies, and (b) deal with some evironment name confusion (e.g. the orginal calls model.matrix which is in both the stats package and the SparseM package, and in some situations the latter was incorrectly called).

See Also

For more details on the vif calculation see vif in the car package.

Examples

    # Running a linear regression on the mtcars data set...
    # ...predicting miles per gallon
    m1 = lm( mpg ~ factor(cyl) + gear + carb + gear*carb,data=mtcars)
    # compare VIF...
    v = getVIF(m1)
    # ...to tolerance (converting to numeric)
    tol = as.numeric(getCoeffTolerance(m1)[-1])
    # tol = 1 / vif
    # but getCoeffTolerance repeats vif across factor levels

Dectech/DectechR documentation built on Feb. 15, 2024, 9:17 a.m.