getCoeffTolerance: Gets tolerance for regression coefficients

View source: R/getOutput.R

getCoeffToleranceR Documentation

Gets tolerance for regression coefficients

Description

Calculates the varience inflation factors (VIF) for linear and generalized linear models, returning the tolerance (1/VIF).

Usage

getCoeffTolerance(mod)

Arguments

mod

A lm or glm object.

Details

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

This function relies on the getVif function which has been adpated from car::vif. When there are categorical/factor variables in the regresion, the car version returns one value for categorical variable as a whole, hence the resulting vector is a different length to the coefficient table.

This function simple expands that result so it can be added to the coefficient table.

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 ~ cyl + disp + hp + gear + carb + gear*carb,data=mtcars)
tol = getCoeffTolerance(m1)


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