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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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