Assume two linear regression models

$$ Y_{b} = \beta_{0b} + x\beta_{1b} + \varepsilon_b \qquad \text{with} \qquad \varepsilon_b \sim N(0, \sigma_b^2) \\ Y_{r} = \beta_{0r} + x\beta_{1r} + \varepsilon_r \qquad \text{with} \qquad \varepsilon_r \sim N(0, \sigma_r^2) $$

and the residual errors are independent ($\varepsilon_b \bot \varepsilon_r$).

My goal is to calculate an exact confidence interval (CI) for the difference between the fitted values of the two models at a specific $x$.

enter image description here

This could be easily done if the two regression lines have about the same residual standard error (see here or here).

Question: How can I get a CI for the difference if $\sigma_b^2 \neq \sigma_r^2$?

Approach: I guess this is like generalizing Welch's $t$-test to the regression framework. However, I am not sure if this is correct?

$$ \frac{\hat{\mu}_b - \hat{\mu}_r - (\mu_b - \mu_r)}{\sqrt{\frac{s^2_{\hat{\mu}_b}}{n_b-1} + \frac{s^2_{\hat{\mu}_r}}{n_r-1}}} \sim t_\nu $$

And how do I get the degrees of freedom $\nu$?

I guess some bootstrap approach might also work but I am more interested in a classical test statistic.

  • $\begingroup$ Shall we presume all $\varepsilon_b$ are independent of the $\varepsilon_r$? $\endgroup$ – whuber Jan 14 at 15:38
  • 1
    $\begingroup$ @whuber Yes, this can be assumed $\endgroup$ – retodomax Jan 14 at 15:38
  • $\begingroup$ Given independence, fit the regression model with all the data. Include an interaction between group and X. Express the differences you want in terms of the parameters of that interaction model, and have the software compute the correct standard errors. $\endgroup$ – BigBendRegion Jan 14 at 16:17
  • $\begingroup$ @BigBendRegion That does not explain my question: How to allow for different residual standard errors? Is my pivot correct? What is the correct degrees of freedom for the $t$-distribution? $\endgroup$ – retodomax Jan 14 at 16:23
  • $\begingroup$ Either model it or use robust standard errors. $\endgroup$ – BigBendRegion Jan 14 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.