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.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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