Write the design and estimand before fitting
The complete synthetic file has eight observations. Group A has x values 0,1,2,3 and outcomes 11,11,13,17. Group B has the same x values and outcomes 14,15,18,23. Define D=0 for A and D=1 for B. Fit y=beta0+beta1*x+beta2*D+beta3*x*D+error. The columns are linearly independent in this file; four parameters leave four residual degrees of freedom. The group labels describe an observational grouping. They are not randomized treatment assignments, and the coefficient does not establish a causal effect of changing a person’s group.
Least squares gives coefficients 10,2,3,1. Group A’s fitted line is 10+2x; group B’s is 13+3x. The conditional group contrast is 3+x: it is 3 at x=0 and 5 at x=2. A statement that the group difference is always 3 ignores the interaction. Recenter the predictor as z=x-2. The same fitted surface has coefficients 14,2,5,1. The group coefficient now describes the contrast at the original x=2. Fitted values, residuals and substantive predictions are unchanged; interpretation changes because the reference point changes.
Residuals in each group are 1,-1,-1,1. SSE is 8 and the conventional residual variance estimate is 8/(8-4)=2. Do not divide by eight when estimating this model’s residual variance under the usual assumptions. The laboratory fits the coefficients from the actual design matrix rather than accepting the asserted coefficients as input, and also fits the simpler common-slope model for comparison.
A contrast interval is not an individual prediction interval
For illustration, impose the conventional linear model assumptions of independent normal errors with common variance and a correctly specified mean. At x=2 the estimated group contrast is 5. Within either group the predictor mean is 1.5 and its centered sum of squares is 5. Each fitted group mean has estimated variance 2[1/4+(2-1.5)^2/5]=0.6. The two group fits use separate observations, so the contrast variance is 1.2. With four residual degrees of freedom and a two-sided 95 percent t critical value approximately 2.776445, the illustrative contrast interval is [1.9586,8.0414].
For a new individual observation from group B at x=2, the fitted value is 19. The prediction variance adds a new observation’s error variance: 2[1+1/4+0.25/5]=2.6. The corresponding illustrative prediction interval is [14.5231,23.4769]. The contrast interval concerns a difference between conditional means; the prediction interval concerns a future individual outcome. Neither is a causal effect interval merely because a group indicator appears in the design.
These are conditional formula demonstrations, not a validated coverage claim for this file. The repeated curved residual pattern directly challenges the assumed straight-line means. In fact, the residual pattern is x^2-3x+1 for the four x values. A quadratic extension can interpolate these eight designed outcomes exactly. A zero residual sum in such a tiny synthetic file is not evidence of perfect future prediction or zero uncertainty. Inspect the model’s inadequacy before recommending the formulas as a trustworthy operating system.
Use the evidence to constrain the decision
A common-slope model without the interaction estimates intercept 9.25, slope 2.5 and group coefficient 4.5, with SSE 10.5. The larger model reduces SSE by 2.5 using one additional parameter. Its usual partial F statistic is (10.5-8)/(8/4)=1.25, conditional on the assumptions needed for that comparison. Training fit improves mechanically when adding an unconstrained parameter. That improvement alone does not establish a stable interaction, a causal explanation or superior future decisions. Predefine comparison criteria and validate the frozen alternatives on relevant later or independent records.
Suppose the business proposes an action costing 2 outcome units per person and demands that a defensible lower benefit bound exceed its cost. The point contrast at x=2 is 5, suggesting a point net difference of 3 only if the contrast could legitimately be interpreted as an action benefit. It cannot yet be so interpreted in this observational file. Even setting that causal problem aside, the illustrative lower contrast bound 1.9586 is below 2 and fails the stipulated conservative rule. The residual curvature supplies another reason to decline an unqualified recommendation. A positive coefficient is not a substitute for a decision contract.
At x=5, outside the observed range 0 through 3, the fitted B line predicts 28 and the contrast becomes 8. Those numbers are algebraic extrapolations, not measurements of a supported population. A randomized assignment could strengthen causal identification for an appropriate intervention, but would not by itself repair curvature, missing outcomes, external validity or an unsupported forecast horizon. The final case memo should include the design and population, reference coding, fit and degrees of freedom, mean-versus-individual uncertainty, residual diagnosis, causal limitation, chronological validation plan, action costs and a revised recommendation under changed facts. Practice is optional; studying the complete core readings and teaching sequence is the course’s intended learning path.
Worked example: Recenter without changing the fit
Substitute x=z+2 into 10+2x+3D+xD. Collect terms to obtain 14+2z+5D+zD. The intercept and group contrast move to the reference x=2; both slopes and all fitted observations remain the same. A changed coefficient label is not a changed dataset or a newly estimated causal effect.
Worked example: An explicit decision can fail despite a positive estimate
At x=2, the illustrative difference is 5 and its conditional lower interval endpoint is about 1.9586. Under a rule requiring a credible lower benefit bound above cost 2, this endpoint fails. More fundamentally, group membership was not randomized and the residuals reveal curvature. Report the failed rule and limitations instead of selecting the point estimate that supports the desired action.