SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Good Morning everyone,

I am new to SAS and have a question.

I have a dataset with one independent Group with 5 levels and one dependent variable Pol.


I am conducting a comparison of means using GLM with the following code:


proc glm data=mylib.'Sheet1$'n;
class Group;
model pol = Group;
lsmeans CDKstage / stderr;

The procedure works fine and shows a highly significant difference between the levels of Group p<.001. Now I would like to conduct a follow up analysis to determine which of the levels of group are different from the others. How do I do a post hoc comparison of means in Proc GLM.

Thank you!!
3 REPLIES 3
deleted_user
Not applicable
I believe I figure it out. I was able to conduct a Tukey pairwise comparison of means by simply adding a T to the lsmeans code as seen below. Because there have been a few views but no suggestion.maybe this will help others.


proc glm data=mylib.'Sheet1$'n;
class Group;
model pol = Group;
lsmeans CDKstage / T stderr;
Paige
Quartz | Level 8
The help for SAS 9.2 doesn't list T as an option in the LSMEANS statement.

It does list ADJUST=T as an option in the LSMEANS statement, which is NOT the TUKEY comparison of means. It is a simple t-test comparison of means.
statsplank
Calcite | Level 5
Hi Docnew,

Try the following:

proc glm data=mylib.'Sheet1$'n;
class Group;
model pol = Group;
lsmeans Group / pdiff adjust=tukey;
run;

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 11270 views
  • 0 likes
  • 3 in conversation