BookmarkSubscribeRSS Feed
ZC
Calcite | Level 5 ZC
Calcite | Level 5

Hi

I am running the following PROC MIXED procedure to compare the difference in Y between group 1 and 2 to the difference in Y between group 3 and 4.

PROC MIXED;

     CLASS group;

     MODEL Y = group  X1  X2;

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

RUN;

The levels of another confounder (e.g., X3) in group 1 and group 3 is physiological higher than the levels in group 2 and group 4. So I cannot include X3 as an independent variable in the model since putting x3 in the model will allow X3 equal in the four groups, which is not true.

To make the comparison of differences in Y between groups (1-2) - (3-4) reasonable, I have to allow X3 comparable between group 1 and group3. So do between group 2 and group 4. How can I achieve it?

Thanks,

1 REPLY 1
SteveDenham
Jade | Level 19

I have done a lot with PROC MIXED and have never run into this situation, and don't really have good advice.  I originally thought of using the AT= option in an LSMESTIMATE statement, but could not see how to restrict the values of X3 depending on the level of group.  I am going to mention some names here, in hope that they can add something, because I truly am at a loss on this.

(whom I see has answered part of this in another thread on this forum)

Steve Denham

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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