Programming the statistical procedures from SAS

subject in repeated statement of proc mixed

Accepted Solution Solved
Reply
Contributor
Posts: 24
Accepted Solution

subject in repeated statement of proc mixed

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


Accepted Solutions
Solution
‎10-03-2014 02:03 PM
Respected Advisor
Posts: 2,655

Re: subject in repeated statement of proc mixed

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


All Replies
Super Contributor
Posts: 490

Re: subject in repeated statement of proc mixed

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

Solution
‎10-03-2014 02:03 PM
Respected Advisor
Posts: 2,655

Re: subject in repeated statement of proc mixed

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

Contributor
Posts: 24

Re: subject in repeated statement of proc mixed

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

Respected Advisor
Posts: 2,655

Re: subject in repeated statement of proc mixed

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

Steve Denham

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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