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

Hi

I am running the following PROC MIXED precedure to examine difference between 2 groups with the difference between another 2 groups.

PROC MIXED;

     CLASS group;

     MODEL Y = group + x1 + x2;

RUN;

Categorical variable "group" has four levels: 1, 2, 3, 4.

I would like to compare the difference in Y between group 1  and 2 to the difference in Y between group 3 and 4. How can I do it?

Thanks,


1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Do not use plus signs in the MODEL statement. For the comparison, use the CONTRAST statement:

CONTRAST 'Difference of differences 1 - 2 - (3 - 4)' group 1 -1 -1 1;

PG

PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

Do not use plus signs in the MODEL statement. For the comparison, use the CONTRAST statement:

CONTRAST 'Difference of differences 1 - 2 - (3 - 4)' group 1 -1 -1 1;

PG

PG
ZC
Calcite | Level 5 ZC
Calcite | Level 5

Thank for answering my question. It is very helpful.

I meet another challenge:

Another confounder (e.g., x3) in group 1 and group 3 is physiological higher than in group 2 and group 4. So I cannot include x3 as a independent variable in the model since putting x3 in the model will allow x3 equal in the four groups. To make the comparison of Y between (1-2) - (3-4) reasonable, I have to allow x3 comparable between group 1 and group3 and between group 2 and group 4.

How can I achieve it?

Thanks,

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 704 views
  • 1 like
  • 2 in conversation