Hello all,
I appreciate you to help me understand what is the difference between these two models. In the first model, in random statement trt1 and trt2 are entered, while in the second model it is empty. (these codes and data are from sas tutorial video)
proc mixed data=test;
class patient trt1 trt2 time;
model resp=trt1 trt2 trt1*trt2 time;
random int trt1 trt2 / subject=patient;
repeated time/ subject=patient*trt1*trt2 type=ar(1);
run;
proc mixed data=test;
class patient trt1 trt2 time;
model resp=trt1 trt2 trt1*trt2 time;
random int / subject=patient;
repeated time/ subject=patient*trt1*trt2 type=ar(1);
run;
patient | trt1 | trt2 | time | resp |
1 | 1 | 1 | 1 | 4.3 |
1 | 1 | 1 | 2 | 3.8 |
1 | 1 | 1 | 3 | 3.1 |
1 | 1 | 1 | 4 | 2.7 |
1 | 1 | 2 | 1 | 4.3 |
1 | 1 | 2 | 2 | 3.4 |
1 | 1 | 2 | 3 | 3.2 |
1 | 1 | 2 | 4 | 3.5 |
1 | 2 | 1 | 1 | 3 |
1 | 2 | 1 | 2 | 3.3 |
1 | 2 | 1 | 3 | 2.5 |
1 | 2 | 1 | 4 | 3.4 |
1 | 2 | 2 | 1 | 3.3 |
1 | 2 | 2 | 2 | 3.2 |
1 | 2 | 2 | 3 | 3 |
1 | 2 | 2 | 4 | 3.2 |
Model 1 essentially models two more random effects compared to model 2: trt1*patient and trt2*patient. Because each patient gets multiple trt1's and multiple trt2's, modeling these two random effects is reasonable. Both models are valid models. Which one is better for your data might be evaluated by examining the Fit Statistics table from PROC MIXED output -- the smaller the fit statistic such as AICC or BIC, the better fit of the model.
Model 1 essentially models two more random effects compared to model 2: trt1*patient and trt2*patient. Because each patient gets multiple trt1's and multiple trt2's, modeling these two random effects is reasonable. Both models are valid models. Which one is better for your data might be evaluated by examining the Fit Statistics table from PROC MIXED output -- the smaller the fit statistic such as AICC or BIC, the better fit of the model.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.