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

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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