BookmarkSubscribeRSS Feed
Chuckytron
Calcite | Level 5

I am learning proc mixed. I have the following model:

proc mixed;

  class group;

  model post = group pre group*pre/ddfm=kr;

The interaction term is significant. How do I take a difference in the lines and construct a 95% confidence band around the difference?

1 REPLY 1
SteveDenham
Jade | Level 19

Warning.  Untested code will follow.

I think you will need lsmeans statements that set the value of pre.  Something like:

proc mixed;

  class group;

  model post = group pre group*pre/ddfm=kr;

  lsmeans group/diff at pre=val1 cl adjdfe=row;

  lsmeans group/diff at pre=val2 cl adjdfe=row;

  lsmeans group/diff at pre=val3 cl adjdfe=row;

  lsmeans group/diff at pre=val4 cl adjdfe=row;

  lsmeans group/diff at pre=val5 cl adjdfe=row;

  ods output diffs=diffs;

run;

The dataset diffs should include the differences between all least squares means of group at various values (val1 through val5) of pre. Here I have variable names, but you really need the values at which you want to estimate the least squares means.  I include an ODS output statement, in case you want to plot the differences and their confidence limits.

Good luck.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

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