Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Computing the 95% confidence interval of a continuous outcome based on STATA's linear regression outputs

    Dear all,

    I came across a seemingly simple question that I would like to discuss here.

    On the context: The dataset contains antibody concentrations from people with rheumatic disease (exposure variable "rheum_yn"==1) and people without rheumatic disease (exposure variable "rheum_yn"==0). Crude and adjusted linear regressions were performed to predict the mean antibody concentrations in people with rheumatic disease versus people without rheumatic disease. Based on the STATA output, it is easy to calculate the mean antibody concentration following the logic 'outcome = slope*exposure + intercept' (i.e. antibody concentration = -0.153*rheum_yn[0 or 1] + 0.22.) However, what is not intuitive is the question how to compute the 95% confidence interval of the mean antibody concentration.

    While for those people without rheumatic disease ("rheum_yn==0") it seems to be the 95% CI of the intercept, I wonder how to compute this for those with rheumatic disease ("rheum_yn==1"). For example to compute the lower 95% CI bound, is it necessary to add together the lower 95% CI bounds of the slope AND the intercept? The same question then applies to the computation of the upper 95% CI bound.

    Regards,
    Hannes
    Click image for larger version

Name:	Screen Shot 2022-05-12 at 11.10.12.png
Views:	2
Size:	1.73 MB
ID:	1664235
    Attached Files

  • #2
    I understand that you want the CI for the both group means.

    Code:
    reg tetanuslog i.rheum_yn
    margins rheum_yn
    Best wishes

    Stata 18.0 MP | ORCID | Google Scholar

    Comment

    Working...
    X