Help using Base SAS procedures

Post hoc comparisons using Proc GLM

Reply
N/A
Posts: 0

Post hoc comparisons using Proc GLM

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!!
N/A
Posts: 0

Re: Post hoc comparisons using Proc GLM

Posted in reply to deleted_user
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;
Super Contributor
Posts: 281

Re: Post hoc comparisons using Proc GLM

Posted in reply to deleted_user
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.
Frequent Contributor
Posts: 77

Re: Post hoc comparisons using Proc GLM

Posted in reply to deleted_user
Hi Docnew,

Try the following:

proc glm data=mylib.'Sheet1$'n;
class Group;
model pol = Group;
lsmeans Group / pdiff adjust=tukey;
run;
Ask a Question
Discussion stats
  • 3 replies
  • 4862 views
  • 0 likes
  • 3 in conversation