Diagnose Violations of Linear Regression Assumptions
SnapchatData Scientist · Technical ScreenLast updated
Tests a candidate's systematic understanding of ordinary least squares (OLS) regression assumptions, distinguishing how specific violations compromise unbiased point estimation, standard error inference, and predictive accuracy.
Scenario
You are tasked with building an explanatory model for user engagement on a multimedia messaging platform. Your primary response variable is daily_time_spent (in minutes), modeled using features such as friend_stories_viewed, direct_snaps_sent, creator_content_minutes, and days_since_signup.
The team wants to use Ordinary Least Squares (OLS) regression to both interpret feature effect sizes for product decisions and forecast user engagement shifts.
Your Task
Walk through a structured audit of the classical Gauss-Markov and normality assumptions underpinning linear regression:
-
Categorization by Impact: Classify the core OLS assumptions according to what fails when they are violated:
- Group A: Unbiasedness and consistency of point estimates (identification of beta).
- Group B: Validity of standard errors, confidence intervals, and hypothesis tests (p-values).
- Group C: Out-of-sample predictive performance.
-
Failure Modes & Diagnostics: For each of the following specific issues, explain the mathematical intuition behind the failure, the primary diagnostic tool (graphical or statistical test), and the appropriate remedy:
- Strict exogeneity violation / omitted variable bias (e.g., user unobserved baseline intent).
- Heteroscedasticity (e.g., variance in time spent increases with friend count).
- Multicollinearity (e.g., high correlation between
friend_stories_viewedanddirect_snaps_sent). - Non-normality of residuals.
-
Practical Trade-offs: In practice, high multicollinearity does not bias OLS coefficients. Explain why product teams often mistake multicollinearity for bias, and describe when it is safe to ignore versus when it must be remediated.
Hints
Hint 1
Recall that unbiasedness depends strictly on the conditional mean of the errors being zero given X (exogeneity), not on the variance structure of the errors.
Hint 2
Heteroscedasticity leaves beta estimates unbiased and consistent, but causes the default OLS variance-covariance matrix estimator to produce incorrect standard errors.
Hint 3
Multicollinearity inflates standard errors by reducing the unique variance contributed by each predictor, making individual coefficients unstable without harming overall model predictions.
Follow-up questions
- If you detect severe heteroscedasticity, why might you prefer Huber-White robust standard errors over a weighted least squares (WLS) approach in production?
- Under what specific condition does omitted variable bias vanish even when a key confounding variable is left out of the regression?
- How does the presence of high multicollinearity affect out-of-sample prediction vs. in-sample coefficient interpretation?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.