gvif.glm | R Documentation |
Computes the generalized variance inflation factor (GVIF) for a generalized linear model.
## S3 method for class 'glm'
gvif(model, verbose = TRUE, ...)
model |
an object of the class glm. |
verbose |
an (optional) logical switch indicating if should the report of results be printed. As default, |
... |
further arguments passed to or from other methods. |
If the number of degrees of freedom is 1 then the GVIF reduces to the Variance Inflation Factor (VIF).
A matrix with so many rows as effects in the model and the following columns:
GVIF | the values of GVIF, |
df | the number of degrees of freedom, |
GVIF^(1/(2*df)) | the values of GVIF^{1/2 df} , |
Fox J., Monette G. (1992) Generalized collinearity diagnostics, JASA 87, 178–183.
gvif.lm
###### 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.