How do you detect and fix heteroscedasticity?
hardAnswer
- Heteroscedasticity = error variance depends on x.
- Detect with a residuals-vs-fitted plot (funnel shape), Breusch-Pagan or White test.
- Consequences: OLS coefficients remain unbiased but standard errors are wrong, so t-tests and CIs are invalid.
- Fixes: (1) transform y (log, sqrt, Box-Cox) if variance increases with the mean; (2) use weighted least squares with weights proportional to 1/variance; (3) use heteroscedasticity-robust (sandwich / White) standard errors.
Check yourself — multiple choice
- Heteroscedasticity means the errors are perfectly Gaussian
- It's non-constant error variance; fix with a transform, WLS, or robust SEs
- It biases the coefficient estimates
- It only affects logistic regression
Non-constant variance → wrong SEs. Fix with transforms, WLS, or robust SEs.
#linear-regression#assumptions
Practise Supervised Learning
215 interview questions in this topic.
Related questions
- What are the classical assumptions of linear regression?
- What is VIF and when do you worry about multicollinearity?
- Why does OLS have a closed-form solution but logistic regression doesn't?
- How do you interpret a coefficient in a multiple linear regression?
- How do you handle strong multicollinearity in a linear model?
- Adding a feature raised R^2. Does that mean the model improved?