liveBook · Manning

Multicollinearity

As explained in Statistics Every Programmer Needs

Multicollinearity is a condition in regression modeling where predictor variables are strongly linearly related to one another.

Multicollinearity occurs when predictors in a regression are strongly linearly related, inflating the variance of estimated coefficients and complicating interpretation. The variance inflation factor (VIF) measures this effect for each predictor. section 5.2.2

Use VIF to assess and respond to predictor redundancy:

  • Regress one predictor against the remaining predictors, obtain its R², and use that value to calculate its VIF. section 5.2.2
  • Treat VIF values of 1 or higher as evidence that multicollinearity is present; consider remediation when any VIF reaches 10 or higher. section 5.2.2
  • Reduce the model by discarding offending predictors, while generally retaining the intercept even when its p-value is not significant. section 5.2.2

Checking a logistic model in Python

For a raisins classification model, regress MinorAxisLength on the other predictors with statsmodels, then read the resulting R². The value 0.9751 indicates that this predictor is highly explained by the others. A statsmodels VIF table reports extreme values, including Area at 404.77, MajorAxisLength at 129.29, and MinorAxisLength at 40.20. A reduced model using MinorAxisLength and Perimeter is then fitted for comparison.

How Statistics Every Programmer Needs covers it

How deep it goes
Explains VIF conceptually and procedurally, demonstrates auxiliary regression and Python calculation, but does not develop the VIF formula algebraically.
Examples
Uses raisins morphology predictors, an auxiliary OLS regression, a VIF table, and a reduced logistic model.
What it assumes
Assumes regression predictors, p-values, R², and model fitting, while introducing VIF-based diagnosis from the regression workflow.
What you can do after
Diagnose multicollinearity with statsmodels VIF calculations and reduce a regression model by removing problematic predictors.
How it connects
Connects multicollinearity to linear regression, logistic regression, VIF, p-values, coefficient variance, and model assumptions.

Also explained in

Compare how 7 books explain multicollinearity →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.