Learn R Programming

misty (version 0.4.1)

collin.diag: Collinearity Diagnostics

Description

This function computes tolerance, standard error inflation factor, variance inflation factor, eigenvalues, condition index, and variance proportions for linear, generalized linear, and mixed-effects models.

Usage

collin.diag(model, print = c("all", "vif", "eigen"), digits = 3, p.digits = 3,
            check = TRUE, output = TRUE)

Arguments

model

a fitted model of class "lm", "glm", "lmerMod", "lmerModLmerTest", "glmerMod", "lme", or "glmmTMB".

print

a character vector indicating which results to show, i.e. "all", for all results, "vif" for tolerance, std. error inflation factor, and variance inflation factor, or eigen for eigenvalue, condition index, and variance proportions.

digits

an integer value indicating the number of decimal places to be used for displaying results.

p.digits

an integer value indicating the number of decimal places to be used for displaying the p-value.#' @param check logical: if TRUE, argument specification is checked.

check

logical: if TRUE, argument specification is checked.

output

logical: if TRUE, output is shown on the console.

Value

Returns an object of class misty.object, which is a list with following entries: function call (call), type of analysis type, model specified in the model argument (model), specification of function arguments (args), list with results (result).

Details

Collinearity diagnostics can be conducted for objects returned from the lm() and glm() function, but also from objects returned from the lmer() and glmer() function from the lme4 package, lme() function from the nlme package, and the glmmTMB() function from the glmmTMB package.

The generalized variance inflation factor (Fox & Monette, 1992) is computed for terms with more than 1 df resulting from factors with more than two levels. The generalized VIF (GVIF) is interpretable as the inflation in size of the confidence ellipse or ellipsoid for the coefficients of the term in comparison with what would be obtained for orthogonal data. GVIF is invariant to the coding of the terms in the model. In order to adjust for the dimension of the confidence ellipsoid, GVIF\(^\frac{1}{2df}\) is computed. Note that the adjusted GVIF (aGVIF) is actually a generalized standard error inflation factor (GSIF). Thus, the aGIF needs to be squared before applying a common cutoff threshold for the VIF (e.g., VIF > 10). Note that the output of collin.diag() function reports either the variance inflation factor or the squared generalized variance inflation factor in the column VIF, while the standard error inflation factor or the adjusted generalized variance inflation factor is reported in the column SIF.

Note that the computation of the VIF and the GVIF is based on the vif() function in the car package by John Fox, Sanford Weisberg and Brad Price (2020), and the computation of eigenvalues, condition index, and variance proportions is based on the ols_eigen_cindex() function in the olsrr package by Aravind Hebbali (2020).

References

Fox, J., & Monette, G. (1992). Generalized collinearity diagnostics. Journal of the Americaln Statistical Association, 87, 178-183.

Fox, J., Weisberg, S., & Price, B. (2020). car: Companion to Applied Regression. R package version 3.0-8. https://cran.r-project.org/web/packages/car/

Hebbali, A. (2020). olsrr: Tools for building OLS regression models. R package version 0.5.3. https://cran.r-project.org/web/packages/olsrr/