Contents
08Interview questions and model answers
Q1What are the assumptions of linear regression?
Give the ladder. Least squares itself needs none. (1) Linearity in the coefficients (true by how we write the model; y may still curve in x, via columns such as x^2) and (2) zero-mean errors given the inputs make it unbiased; a curve we failed to model breaks (2). Adding (3) constant variance and (4) independent errors makes it BLUE (Gauss–Markov), with variance \sigma^2(X^\top X)^{-1}. Adding (5) normal errors makes \hat\beta exactly normal, so confidence intervals and t tests are exact for any n. The inputs must have full column rank. Shorthand: LINE (linearity, independence, normality, equal variance).
Q2Derive the least-squares estimate.
Minimize \|y-X\beta\|^2=y^\top y-2\beta^\top X^\top y+\beta^\top X^\top X\beta. The gradient -2X^\top y+2X^\top X\beta is zero at the normal equations X^\top X\hat\beta=X^\top y, so \hat\beta=(X^\top X)^{-1}X^\top y when X has full column rank. Geometrically, X\hat\beta is the orthogonal projection of y onto the column space of X, and the residuals are perpendicular to every column.
Q3What does it mean that least squares is unbiased?
Repeat the study with new samples from the same population: the estimates differ from study to study, but their average is the true coefficient, \E[\hat\beta]=\beta. Right on average, not right every time. It needs Assumptions 1 and 2: substituting y=X\beta+\varepsilon gives \hat\beta=\beta+(X^\top X)^{-1}X^\top\varepsilon, and the last term averages zero when \E[\varepsilon\mid X]=0.
Q4What does the Gauss–Markov theorem say, and what does it need?
Under linearity, zero-mean errors, constant variance and uncorrelated errors (and full rank), least squares has the smallest variance among all linear unbiased estimators. It does not need normality, and it says nothing about biased estimators, which can have a lower mean squared error.
Q5What is omitted-variable bias?
Leaving out a variable x_2 that affects y and moves with an included x_1 biases the slope of x_1: \E[\tilde\beta_1]=\beta_1+\beta_2\delta_1, where \delta_1 is the slope of x_2 on x_1. In our data, blood pressure alone gets 2.46, but 1.38 once body mass index is included. At the extreme the sign flips (Simpson’s paradox).
Q6What happens if the errors are heteroscedastic? How do you detect and fix it?
The coefficients stay unbiased, but the usual standard errors, tests and intervals are wrong, and least squares is no longer the most efficient. Detect it with a funnel in the plot of residuals against fitted values, or with the Breusch–Pagan test. Fix the standard errors with White’s robust (sandwich) estimator, or measure the spread with the bootstrap; fit with weighted least squares; or transform the outcome, for example \log y.
Q7How do you build a 95\% confidence interval for a coefficient, and what does it mean?
\hat\beta_j\pm t_{0.975,\,n-p-1}\,\mathrm{SE}(\hat\beta_j), about \pm1.97 standard errors for large n; use the robust standard error if the variance is not constant. Over repeated studies, 95\% of the intervals built this way contain the true \beta_j. For our slope: 10.2\pm1.97\times0.61, from 9.0 to 11.4. A strong association, but not by itself proof of cause.
Q8Do the residuals have to be normal? Do x and y?
Normal errors are needed only for exact small-sample tests and intervals. With large n the coefficients are approximately normal anyway, because each is a weighted sum of many independent errors (central limit theorem). The inputs and the outcome can have any distribution; the assumption is about the errors given the inputs.
Q9What is multicollinearity and why does it matter?
Inputs that are nearly linear combinations of each other. Perfect collinearity makes X^\top X singular. Strong collinearity keeps the estimates unbiased but inflates their variance by \mathrm{VIF}_j=1/(1-R_j^2): coefficients become unstable and can take implausible signs, while predictions are unaffected. Flag VIFs above 5 or 10; drop or combine inputs, or use ridge regression.