Hello,
I have a hierarchical data with subjects nested within groups. Same subjects participated in seven events, and those seven events were grouped into 3 phases for some reason. We measured the outcome of our interest prior to and following each event, so we have pre and post data at each event.
Therefore, my understanding of the data structure is that
; groups >> subjects >> phases >> events >> pre/post
Our main research interest is if there is any statistical difference in the outcome between pre and post by phases.
Here are my SAS codes first.
And my Stata codes.
I get similar but different results, and I am trying to figure out why.
Is there any problem with my codes? Or are there any fundamental differences between SAS proc mixed and Stata mixed?
Perhaps, my modeling is wrong?
I would really appreciate any comments.
Thanks.
I have a hierarchical data with subjects nested within groups. Same subjects participated in seven events, and those seven events were grouped into 3 phases for some reason. We measured the outcome of our interest prior to and following each event, so we have pre and post data at each event.
Therefore, my understanding of the data structure is that
; groups >> subjects >> phases >> events >> pre/post
Our main research interest is if there is any statistical difference in the outcome between pre and post by phases.
Here are my SAS codes first.
Code:
proc mixed data=DATASET; class GROUP SUBJECTID PHASE EVENTNO PREPOST; model OUTCOME= PHASE|PREPOST GROUP / solution ddfm=satterthwaite; random intercept / subject=SUBJECTID; random intercept / subject=PHASE(SUBJECTID); random intercept / subject=EVENTNO(PHASE); repeated PREPOST / subject=EVENTNO(PHASE*SUBJECTID) type=un; run;
Code:
mixed OUTCOME PHASE##PREPOST i.GROUP || SUBJECTID: || PHASE: || EVENTNO:, residuals(unstr, t(PREPOST)) variance
Is there any problem with my codes? Or are there any fundamental differences between SAS proc mixed and Stata mixed?
Perhaps, my modeling is wrong?
I would really appreciate any comments.
Thanks.
Comment