BookmarkSubscribeRSS Feed
smortaheb
Calcite | Level 5

Hello, 

 

I have a dataset which has observations before and after a treatment in 2 conditions. So I have "post" and "Pre" treatment measurements in condition "A" and "post" and "pre" treatment measurements in condition "B". I want to compare (Post - Pre) in condition A with (Post - Pre) in condition B. For that, I wrote the following code(time represents pre and post): 

 

PROC MIXED method=REML, data=my_data;

class subj_id condition time gender;

model value = time condition gender time*condition;

random int / subject=subj_id type=UN;

contrast 'my_contrast' time*condition 1 -1 -1 1;

RUN;


Because I am new to SAS, I don't know whether this code does the same thing that I want or not. Can you help me to understand it better. Thanks! 

1 REPLY 1
PaigeMiller
Diamond | Level 26

Use the E option of the contrast statement, this will tell you what is being multiplied by 1 and what is being multiplied by –1.

 

contrast 'my_contrast' time*condition 1 -1 -1 1/e;

 

--
Paige Miller

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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