Inspect the fitted relationship before selecting a standard error
Use the eight-row dataset from unit two. The additive fit is yhat=10+2x+5D, with residuals −1.5, −.5, .5, 1.5 in the first group and 1.5, .5, −.5, −1.5 in the second. The total residual sum and each design-column residual cross-product are zero. That orthogonality is an algebraic consequence of least squares, not evidence that the mean specification is adequate. Within-group residual patterns show opposite slopes. Plot residuals against x with group labels; the interaction model in unit three explains those patterns exactly in this deliberately constructed sample.
A residual plot can suggest a missing term, scale dependence or a recording error, but it does not uniquely identify a cause. Compare a defensible alternative mean specification, substantive process knowledge and out-of-sample behavior. Adding enough terms can fit a small sample perfectly while making prediction unstable. A perfectly fitted teaching dataset does not mean future observations have zero noise. State which changes were exploratory and what further evidence would evaluate them.
Leverage concerns a row's position in the design, while a residual concerns its vertical departure from the fitted response. Influence combines these features and depends on the fitted model. For the additive example, leverage is .475, .275, .275, .475 in each group and sums to the three fitted parameters. The sum is a projection identity; it does not make .475 an automatic deletion threshold. Check a flagged observation against the underlying definition and measurement process, then report sensitivity rather than silently remove a valid large customer.
Three covariance calculations answer different conditional questions
For a full-rank design X, OLS b=(X′X)⁻¹X′y. Under the classical conditional homoskedastic model, estimated covariance is s²(X′X)⁻¹, where s²=SSE/(n−p) and p includes the intercept. Our sample has SSE=10, n=8 and p=3, so s²=2. The x-slope variance is .2 and its standard error is about .4472. A finite-sample t interpretation adds distributional assumptions; the matrix formula alone does not establish coverage.
HC0 replaces the constant-variance middle term with the sum of x_i x_i′ e_i². HC1 multiplies that sandwich by n/(n−p). The official statsmodels reference specifies this particular correction; robust software options with other names need not be identical. In this constructed sample HC1's x-slope variance is 41/125=.328, giving standard error about .5727. Both procedures retain the same OLS coefficient 2. Changing covariance does not change the fitted mean or make its omitted interaction disappear. With eight observations, asymptotic justification is especially limited; these values illustrate formulas rather than validate a real population interval.
When errors can depend within a genuine independent sampling or assignment cluster, cluster scores sum x_i e_i within each cluster before the sandwich is formed. That retains within-cluster covariance terms that row-level HC methods omit. The cluster definition must follow how information or shocks are shared, not whichever grouping makes a result favorable. Cameron and Miller explain the many-independent-cluster conditions and complications from few clusters. More rows in two groups do not create many independent clusters.
Refuse unsupported precision and report sensitivity
For illustration only, group these eight rows by D. A common CR1 factor is [G/(G−1)]×[(n−1)/(n−p)]=14/5 for G=2. The resulting slope variance is 7/5 and standard error about 1.1832. Two clusters are intentionally inadequate for routine many-cluster inference. Do not attach a nominal confidence claim to that calculation or conclude that switching to a cluster label solves the design. A real analysis needs defensible dependence assumptions, enough independent information and an appropriate finite-sample strategy or a narrower claim.
Now add a valid large observation x=20, D=1, y=100. The additive coefficients become approximately 5.6061, 4.9293 and −6.2121. The indicator coefficient changes sign. First investigate whether the row uses the same unit, timing and outcome definition; if valid, the larger support and its weight may materially change the target relationship. Compare model fit, interaction or nonlinear alternatives and the intended prediction population. Report estimates with and without the row as sensitivity, with reasons, rather than present the favorable estimate alone.
A useful diagnostic memo separates recording mistakes, support limitations, mean misspecification, dependence and sensitivity to influential observations. State a response to each: correction with an audit trail, restricted extrapolation, a justified alternative model, design-appropriate uncertainty or additional independent data. None of these operations by itself identifies a causal effect. Do not trade a precise unsupported claim for a vague statement that everything is uncertain; specify what the data do support and which decision remains unresolved.
Worked example: Reconcile covariance without changing the estimate
The slope is 2 under the classical and HC1 calculations. Classical variance is .2; HC1 variance .328. Their square roots are approximately .4472 and .5727. The larger HC1 value does not establish that HC1 is correct in this tiny misspecified sample. Show the residual interaction pattern separately and distinguish the mean-model problem from the variance-model calculation.
Worked example: A large valid account changes the fitted question
Adding x=20, D=1, y=100 yields b0=185/33, bx=488/99 and bD=−205/33. The indicator becomes negative even though its earlier estimate was 5. Inspect support, functional form and the account definition. Deleting the account solely to recover a positive indicator selects the result rather than repairs evidence. A population including large accounts may require a materially different model or weighting target.