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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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