A small dataset that can be checked completely
Use eight synthetic observations with columns(x,D,y): (0,0,8.5), (1,0,11.5), (2,0,14.5), (3,0,17.5), (4,1,24.5), (5,1,25.5), (6,1,26.5), (7,1,27.5). Interpret x as a measured business input and D as a binary group. These are deliberately constructed training data, not actual customer or learner records. The target fitted model is y=b0+b1x+b2D+e.
Ordinary least squares minimizes the sum of squared residuals. With design columns 1,x,Dand full column rank, its normal equations are X'X b=X'y. Here X'X has rows (8,28,4),(28,140,22),(4,22,4), and X'y=(156,670,104). Solving gives b=(10,2,5). Fitted values are 10+2x+5D; residuals are (−1.5,−.5,.5,1.5,1.5,.5,−.5,−1.5). Their sum and their products with each design column sum to zero, as the normal equations require.
The residual sum of squares is 10. Total centered sum of squares is 388, so R²=1−10/388=189/194≈.97423. This high in-sample fit does not establish the common slope is correctly specified or causally identified. Later units show that the two groups follow different slopes in this constructed example. A model can have high R² while omitting a consequential interaction.
Partialling out reveals the identifying linear variation
To understand the x coefficient, first regress x on the intercept and D. That subtracts group means 1.5 and5.5. Residual x values within each group are (−1.5,−.5,.5,1.5). Regress y on the same controls: group means are 13 and26. The residual y values in group 0 are three times residual x; in group 1 they are one times residual x. The sum of residual-x squared is10 and the residual cross-product is20. The residual-on-residual slope is 20/10=2, exactly the full regression's x coefficient.
This is the sample partialling-out identity in the matched OLS setup, not a new experimental design. It tells us which linear variation remains after the specified controls. If almost no x variation remains, separate slopes may be unstable; if no variation remains, the separate coefficient is not uniquely determined. Imperfect correlation among regressors is not by itself bias, and mutual independence of every regressor is not an OLS requirement. Exogeneity and the model's conditional interpretation are different questions.
Dropping D here produces simple-regression slope 62/21≈2.95238 and intercept 55/6≈9.16667. The larger simple slope combines within-group patterns with between-group differences. Calling the controlled 2 a causal effect still requires a defensible argument about assignment, omitted factors and the counterfactual. The algebra shows conditional association and a decomposition; it does not prove that changing x by one causes y to rise by two.
Rank, overlap and the actual contrast
Add another regressor w=2x. Then the coefficient on x and twice the coefficient on w appear only through their sum. Both(b1=2,bw=0)and(b1=0,bw=1) generate the same fitted x contribution. There is no unique pair of separate coefficients. A routine returning one arbitrary solution does not create information that distinguishes them. The exact training laboratory detects rank deficiency rather than hiding it by adding a small number to the matrix.
The dataset also lacks x overlap between groups: D=0 has x from 0 to 3,while D=1 has x from 4 to 7. The additive group coefficient 5 is a model-based contrast holding x fixed, but the data do not observe both groups at the same x. Adding a control or centering x does not create that comparison. An intervention that also changes service scope, customer mix or timing may not correspond to a coefficient's hold-the-other-columns-fixed contrast.
Report a jointly relevant fitted contrast, with units and covariance, rather than read a table one coefficient at a time. A policy raising xand changing Dcan require a combination of coefficients and may cross unsupported regions. For real floating-point analysis, conditioning and appropriate numerical methods matter; the small exact-fraction laboratory is a transparent teaching calculation, not a claim that forming an inverse of normal equations is the best general production solver.
Worked example: Reconstruct the normal equations
For b=(10,2,5), the first equation is8×10+28×2+4×5=156. The second is28×10+140×2+22×5=670. The third is4×10+22×2+4×5=104. All residual-design cross-products vanish. This verifies the least-squares solution for the supplied full-rank design. It does not verify a sampling assumption, causal model or future regime. A reproducible report should preserve the input rows and units so this check can be repeated.
Worked example: A combined fitted contrast needs covariance
Under a separately stipulated homoskedastic calculation for the additive model, residual variance estimate is10/(8−3)=2. The estimated variance of b1 is.2,of b2 is4.2 and their covariance−.8. For a hypothetical contrast increasing x by 1 and D by 1,the fitted change is7 and its calculated variance is.2+4.2+2(−.8)=2.8,so SE≈1.67332. Ignoring covariance gives 4.4 instead. This is conditional uncertainty arithmetic, not a justified causal group-switch policy; the dataset's lack of overlap and interaction pattern still require criticism.