BookmarkSubscribeRSS Feed
Luba
Calcite | Level 5
Hello there!

i am using proc glm with contrast to compare three means (i.e., one-way anova). see my SAS code:

SAS CODE
proc glm data=ITT; class group; model BMD=group; means group;
contrast 'A>B>C: A vs B' group 1 -1 0;
contrast 'A>B>C: B vs C' group 0 1 -1;
contrast 'A>B>C: C vs A' group 1 0 -1;
contrast 'A=B>C: A+B vs C' group 1 1 -2; run; quit;

This produces output with:
1) a p-value for the three-way comparison,
2) means for each group and their corresponding SDs
3) a mean square and p-value for each contrast

I would also like to obtain:
1) means for each group and their corresponding 95% confidence intervals (instead SDs)
2) differences between the means and the corresponding 95% confidence intervals for the differences between the means. Is it possible to obtain this using contrasts?

Please and thank you help me. Luba 🙂
1 REPLY 1
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12
You would be better off using LSMEANS rather than MEANS statement (under most circumstances). Then your request is also easy:
lsmeans group / cl pdiff;
will give you confidence limits and all possible pair-wise differences.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 7867 views
  • 0 likes
  • 2 in conversation