Run proc mixed with only specific parts of variable

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

Run proc mixed with only specific parts of variable

I'm trying to run proc mixed with a variable (drug) that has three components to it (drugs a, b, and c). How do I change the code to run proc mixed ONLY on drugs a and b?

 

 

PROC MIXED DATA=lec2.fevlong ORDER=DATA;
CLASS pid drug timehr;
MODEL y=drug timehr drug*timehr/S CHISQ;
REPEATED timehr /TYPE=UN SUBJECT=pid R RCORR;
RUN;


Accepted Solutions
Solution
‎04-03-2018 10:36 AM
Super User
Posts: 13,583

Re: Run proc mixed with only specific parts of variable

Without seeing actual values of the variable drug this is just a generic response:

Add a WHERE statement.

 

PROC MIXED DATA=lec2.fevlong ORDER=DATA;

WHERE data in ('drug a' 'drug b');
CLASS pid drug timehr;
MODEL y=drug timehr drug*timehr/S CHISQ;
REPEATED timehr /TYPE=UN SUBJECT=pid R RCORR;
RUN;

View solution in original post


All Replies
Solution
‎04-03-2018 10:36 AM
Super User
Posts: 13,583

Re: Run proc mixed with only specific parts of variable

Without seeing actual values of the variable drug this is just a generic response:

Add a WHERE statement.

 

PROC MIXED DATA=lec2.fevlong ORDER=DATA;

WHERE data in ('drug a' 'drug b');
CLASS pid drug timehr;
MODEL y=drug timehr drug*timehr/S CHISQ;
REPEATED timehr /TYPE=UN SUBJECT=pid R RCORR;
RUN;

☑ This topic is solved.

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

Discussion stats
  • 1 reply
  • 89 views
  • 0 likes
  • 2 in conversation