Dear Stata community,

This is my first post on the forum. I'm struggling to recreate figure 1 from Bleakeley & Chin (2004) [see attached picture].

I have managed to plot panel A with the raw data (not regression-adjusted) which I think is fine for my project. However it would the interesting to see the regression-adjusted results as well. I have tried the following code
Code:
reg var1 var2 var3 var4, r

predict var1_hat if treatment == 1, xb
predict var1_hat if treatment == 0, xb

graph tw (lowess var1_hat var2 if treatment == 1) (lowess var1_hat var2 if treatment == 0)
However, the results look weird (both lines are almost on top of each other - maybe I have over-regression-adjusted?).

More importantly: Can someone point me in the right direction how to approach recreating panel B? I'm really not sure how to get started with that one. Just manually calculating means between both groups? But then how to graph confidence intervals between these lines (important because I suspect the differences might not be statistically significant)?

Unfortunately I can't show my data or output because it is confidential and on a remote server. However, I hope I have provided enough information for someone to help me in the right direction.



Array