BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Peter_Y
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

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

View solution in original post

4 REPLIES 4
mohamed_zaki
Barite | Level 11

Although i think your code is typo

but this mean that you specify that your data is nested

check this for more clarification

http://www.thejuliagroup.com/documents/procmixed1.pdf

SteveDenham
Jade | Level 19

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

Peter_Y
Calcite | Level 5

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

SteveDenham
Jade | Level 19

If patient id is unique, then you don't need the parenteheses (or crossed, for that matter) notation.

Steve Denham

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 4 replies
  • 2701 views
  • 0 likes
  • 3 in conversation