Code:
clear set seed 1234 set obs 200 gen id = _n expand 3 sort id bysort id: gen time = _n gen x = runiform()<0.5 bysort id: gen trtx = x if _n==1 bysort id: egen trt = min(trtx) drop x trtx gen outcome = runiformint(20, 40)
Given the example data above, I have analysed the treatment effect as:
mixed outcome i.time##i.trt ||id: , reml nolog
However, a reviewer has requested and inclusion of baseline adjustment at time point 1 and I'm struggling with coding this. I will appreciate it if anyone can provide suggestions on how to code the data to adjust for baseline assessment at timepoint 1.
Thank you
0 Response to baseline adjustment in multiple time point
Post a Comment