Multiple Linear Regression and Multicollinearity
Use city demographics to model annual pharmacy profit, interpret partial coefficients, and assess multicollinearity.
| Source column | Meaning and unit |
|---|---|
Profit |
Annual pharmacy profit, US dollars; the outcome Y |
Income |
City median annual salary, US dollars |
Disposable Income |
City median income after taxes, US dollars |
Birth Rate (per 1,000) |
Births per 1,000 residents |
Soc Security (per 1,000) |
Social-security recipients per 1,000 residents |
CV Death (per 100,000) |
Cardiovascular deaths per 100,000 residents |
% 65 or Older |
Residents aged 65+, in percentage points: 14 means 14% |
Location identifies a city; it is not a numerical predictor. The file contains 110 cities with observed profit and one proposed Kansas City location with no profit yet.
The response is annual Profit. The design table contains an intercept column const and six demographic columns. sm.add_constant() creates the column of ones; .fit() estimates all seven coefficients together.
Compare two otherwise identical demographic profiles. Hold the other five predictors fixed.
| Input difference | Difference in fitted annual profit, full model |
|---|---|
| Income higher by US$1,000 | About US$599 higher |
| Disposable income higher by US$1,000 | About US$2,535 higher |
| Birth rate higher by 1 birth per 1,000 | About US$1,704 higher |
| Age 65+ share higher by 1 percentage point | About US$7,714 higher |
Each line keeps the other inputs fixed. Move disposable income along it, or change the age-65+ share. Both axes use USD thousands.
Compare Income-only and six-predictor models on the same 110 cities. Adding inputs cannot lower training R² when both models include an intercept. Adjusted R² also accounts for the number of fitted predictors; it can fall when an added input contributes too little.
\(R^2_{adj}=1-\dfrac{SSE/(n-k-1)}{SST/(n-1)}\). Here \(n=110\), \(k=6\) and \(n-k-1=103\). The intercept is estimated but is not counted in \(k\).
The course uses regression RMSE \(s=\sqrt{SSE/(n-k-1)}\). Six demographic predictors and one intercept leave 103 residual degrees of freedom. Here \(s\approx\text{US}\$13,547\) per year.
Multicollinearity is linear dependence among the predictors. If one input is nearly a linear combination of the others, little independent variation remains to estimate its separate association with profit.
In these cities, social-security recipients and the share aged 65+ move closely together.
Perfect dependence: coefficients are not uniquely identifiable. Strong imperfect dependence: coefficients can be estimated but may be imprecise.
Strong imperfect dependence makes the separate predictor associations hard to estimate.
| What changes? | Consequence |
|---|---|
| Coefficient estimates | Small data changes can alter their size or sign; estimates depend on the other predictors included. |
| Standard errors | Coefficient variance and SE increase, other conditions held fixed. |
| Numerical stability | Near-perfect dependence can amplify rounding and numerical errors. |
Not automatic bias: imperfect multicollinearity does not itself bias OLS under a correctly specified, full-rank model with zero conditional mean error.
Individual t-tests and coefficient intervals depend on the coefficient SE.
| What changes? | Consequence |
|---|---|
| Individual t-tests | Lower power; a useful predictor may have a large p-value after accounting for the others. |
| Coefficient confidence intervals | Wider intervals can include zero and both signs. |
| Overall F-test and R² | A significant joint test and high training R² can coexist with weak individual t-tests. |
A large p-value can reflect imprecision, rather than the absence of a useful association.
Individual coefficients can be uncertain while their combined prediction remains precise for familiar input combinations.
| Target | What multicollinearity means |
|---|---|
| Point prediction | Can remain stable for familiar combinations; validate accuracy on test data. |
| Mean-response CI | Can remain narrow for familiar combinations, but widen for unusual combinations. |
| New-outcome PI | Adds new-outcome noise to fitted-mean uncertainty; not automatically wide. |
Joint support matters: familiar social-security and age-share ranges do not guarantee a familiar combination. Validate predictions on representative test data.
For each demographic input \(X_j\), fit an auxiliary regression on the other five inputs. Then \(VIF_j=1/(1-R_j^2)\). Profit is not used in this auxiliary regression. A large value signals little variation unique to that input.
For a smaller VIF illustration, use Income, Disposable Income and the age-65+ share. Fit three auxiliary regressions. Each takes one of these inputs as its response and the other two as predictors. Do not use Profit.
The relationship is nonlinear: auxiliary R² of 0.5 gives VIF=2; 0.9 gives VIF=10; 0.99 gives VIF=100. The graph illustrates the formula rather than six estimated pharmacy VIFs.
\(H_0:b_1=b_2=\cdots=b_6=0\) versus \(H_1\): at least one slope differs from zero. Compare the six-input profit model with an intercept-only mean-profit model. The intercept is not part of the joint null.
\(F=(SSR/k)/(SSE/(n-k-1))\). Here \(k=6\) and the denominator degrees of freedom are 103. The pharmacy fit gives \(F\approx53.12\).
For social-security recipients, test \(H_0:b_j=0\) against \(H_1:b_j\ne0\). The two-sided test asks whether this partial linear association differs from zero after including the other five inputs.
A large overall F can coexist with small absolute t statistics for some inputs. The six demographics jointly help explain profit, while some separate associations remain imprecise.
In this sample, F≈53.12, while the social-security t statistic is about −0.43. The overall F-test and an individual t-test answer different questions.
The final row is the proposed Kansas City store. Supply all six demographic inputs in the same column order as the fitted design. Add the intercept column explicitly for this single new row.
Start with the proposed city’s inputs. Predict with the full model, then increase Disposable Income by US$1,000 while keeping every other input unchanged. Predict the difference before running. Does it equal 1,000 times that input’s fitted slope?
Prof. Xuhu Wan · HKUST ISOM · Introduction to Business Analytics