Feb 27, 2025
Exam corrections (optional) due Tuesday, March 4 at 11:59pm
Team Feedback (email from TEAMMATES) due Tuesday, March 4 at 11:59pm (check email)
DataFest: April 4 - 6 - https://dukestatsci.github.io/datafest/
Multicollinearity
Definition
How it impacts the model
How to detect it
What to do about it
# A tibble: 5 × 7
volume hightemp avgtemp season cloudcover precip day_type
<dbl> <dbl> <dbl> <chr> <dbl> <dbl> <chr>
1 501 83 66.5 Summer 7.60 0 Weekday
2 419 73 61 Summer 6.30 0.290 Weekday
3 397 74 63 Spring 7.5 0.320 Weekday
4 385 95 78 Summer 2.60 0 Weekend
5 200 44 48 Spring 10 0.140 Weekday
Source: Pioneer Valley Planning Commission via the mosaicData package.
Outcome:
volume
estimated number of trail users that day (number of breaks recorded)Predictors
hightemp
daily high temperature (in degrees Fahrenheit)
avgtemp
average of daily low and daily high temperature (in degrees Fahrenheit)
season
one of “Fall”, “Spring”, or “Summer”
precip
measure of precipitation (in inches)
We can create a pairwise plot matrix using the ggpairs
function from the GGally R package
We can. use corrplot()
in the corrplot R package to make a matrix of pairwise correlations between quantitative predictors
What might be a potential concern with a model that uses high temperature, average temperature, season, and precipitation to predict volume?
Ideally the predictors are orthogonal, meaning they are completely independent of one another
In practice, there is typically some dependence between predictors but it is often not a major issue in the model
If there is linear dependence among (a subset of) the predictors, we cannot find estimate
If there are near-linear dependencies, we can find
Multicollinearity: near-linear dependence among predictors
Data collection method - only sample from a subspace of the region of predictors
Constraints in the population - e.g., predictors family income and size of house
Choice of model - e.g., adding high order terms to the model
Overdefined model - have more predictors than observations
where
Common practice uses threshold
Variables with similar values of VIF are typically the ones correlated with each other
Use the vif()
function in the rms R package to calculate VIF
Large variance for the model coefficients that are collinear
Unreliable statistical inference results
Interpretation of coefficient is no longer “holding all other variables constant”, since this would be impossible for correlated predictors
Collect more data (often not feasible given practical constraints)
Redefine the correlated predictors to keep the information from predictors but eliminate collinearity
For categorical predictors, avoid using levels with very few observations as the baseline
Remove one of the correlated variables
Introduced multicollinearity
Definition
How it impacts the model
How to detect it
What to do about it