Confidence interval for the difference of independent regression slopes (source code)

= Confidence interval for the difference of independent regression slopes
{title2=$\widehat b-\widehat d\pm t_{2m-4,1-\alpha/2}s\sqrt{S_u^{-1}+S_w^{-1}}$}

For two independent normal simple regressions with centered predictors, common unknown error variance and $m>2$ observations in each, let $S_u=\sum u_i^2$, $S_w=\sum w_i^2$. The estimated slope difference is normal with mean $b-d$ and variance $\sigma^2(S_u^{-1}+S_w^{-1})$. Pool the two <residual sums of squares> and use $s^2=RSS/(2m-4)$. Independence from the estimates gives a <Student t-distribution> pivot, yielding the displayed two-sided interval of confidence $1-\alpha$.