Regression and adjustment
Change the relationships in the data. Follow the same observation from the original scatterplot to its adjusted position.
The observed relationship
How y varies with x before adjusting for z.
After removing the linear relation to z
Residual y against residual x. The slope is the adjusted coefficient.
Frisch–Waugh–Lovell
What “holding z fixed” does to the data
Fit x on z and save its residuals. Do the same for y. Regressing those residuals on each other recovers the coefficient of x from the full regression. All three steps use the same observations and include an intercept when removing z.
The slope identity does not transfer the residual regression’s default standard error. The uncertainty shown here comes from the full model, with n − 3 residual degrees of freedom and the selected covariance estimator.
Where the unadjusted slope comes from
In this sample, the unadjusted slope equals the adjusted x coefficient plus the fitted z coefficient multiplied by the slope from regressing z on x. This is an exact least-squares decomposition, including sampling variation.
Inspect every residualized observation
How much does one observation matter?
Leverage measures an unusual combination of x and z. A residual measures distance from the fitted surface. An observation can have one without the other; Cook’s distance combines both.
Select a point or use the observation control. Diagnostics use the full x-and-z model.
Offsets are relative to the original observation. Only one observation is modified at a time; selecting another point does not change the data.
The comparison temporarily omits the selected observation without deleting it. A large diagnostic is a reason to investigate measurement, specification and sensitivity. It is not a deletion rule. Cook’s distance and standardized residuals use the conventional residual variance, even when robust standard errors are selected.
Reproduce this exact experiment
Export the CSV and do-file together. The file imports the displayed observations, estimates both models, constructs the partial-regression plot and computes influence diagnostics in Stata.
The seed belongs to the browser generator. Using the same number with Stata’s random-number generator would produce different data.