Learn R Programming

glmtoolbox (version 0.1.12)

gvif.glm: Generalized Variance Inflation Factor

Description

Computes the generalized variance inflation factor (GVIF) for a generalized linear model.

Usage

# S3 method for glm
gvif(model, verbose = TRUE, ...)

Value

A matrix with so many rows as effects in the model and the following columns:

GVIFthe values of GVIF,
dfthe number of degrees of freedom,
GVIF^(1/(2*df))the values of GVIF\(^{1/2 df}\),

Arguments

model

an object of the class glm.

verbose

an (optional) logical switch indicating if should the report of results be printed. As default, verbose is set to TRUE.

...

further arguments passed to or from other methods.

Details

If the number of degrees of freedom is 1 then the GVIF reduces to the Variance Inflation Factor (VIF).

References

Fox J., Monette G. (1992) Generalized collinearity diagnostics, JASA 87, 178–183.

See Also

gvif.lm

Examples

Run this code
###### Example 1: Fuel consumption of automobiles
Auto <- ISLR::Auto
Auto2 <- within(Auto, origin <- factor(origin))
mod <- mpg ~ cylinders + displacement + acceleration + origin + horsepower*weight
fit1 <- glm(mod, family=inverse.gaussian("log"), data=Auto2)
gvif(fit1)

###### Example 2: Patients with burn injuries
burn1000 <- aplore3::burn1000
burn1000 <- within(burn1000, death <- factor(death, levels=c("Dead","Alive")))
mod2 <- death ~ gender + race + flame + age*inh_inj + tbsa*inh_inj
fit2 <- glm(mod2, family=binomial("logit"), data=burn1000)
gvif(fit2)

###### Example 3: Hill races in Scotland
data(races)
fit3 <- glm(rtime ~ log(distance) + cclimb, family=Gamma(log), data=races)
gvif(fit3)

Run the code above in your browser using DataLab