Hello:
I hope to run a mixed model with proc mixed but get confused by the syntax of subject option in the repeated statement. Suppose we have several clinical trials which collects variables: response, treatment, patient_id, baseline, study_id. I saw someone using
proc mixed;
class patient_id drug;
model response = baseline treatment;
repeated / subject=study_id(patient_id) group=study_id;
run;
what does "study_id(patient_id)" means? None of the SAS books I have specify subject variable with another variable in parenthesis next to it. Really confused......
Thanks,
Peter
Peter,
There is a high likelihood that patient_id is unique within a study, but may not be across studies. This nested characteristic gives rise to the parentheses notation. However, if you inspect the parameterization documentation for PROC MIXED, you find that study_id(patient_id) and study_id*patient_id have identical matrix representations. The repeated statement in the code snippet you provided thus guarantees (provide the data are clean) unique identification of each subject, and separate variance components due to study.
Steve Denham
Although i think your code is typo
but this mean that you specify that your data is nested
check this for more clarification
Peter,
There is a high likelihood that patient_id is unique within a study, but may not be across studies. This nested characteristic gives rise to the parentheses notation. However, if you inspect the parameterization documentation for PROC MIXED, you find that study_id(patient_id) and study_id*patient_id have identical matrix representations. The repeated statement in the code snippet you provided thus guarantees (provide the data are clean) unique identification of each subject, and separate variance components due to study.
Steve Denham
Is this the only reason for using the parentheses notation? If I create a unique id at patient level, I don't need parentheses notation? I am really confused when people start to talk about nested or crossover effects. I thought the parentheses notation has sth. to do with the model itself......
Thanks,
Peter
If patient id is unique, then you don't need the parenteheses (or crossed, for that matter) notation.
Steve Denham
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.