- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 08-16-2009 04:17 AM
(11269 views)
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!!
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
proc glm data=mylib.'Sheet1$'n;
class Group;
model pol = Group;
lsmeans CDKstage / T stderr;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Docnew,
Try the following:
proc glm data=mylib.'Sheet1$'n;
class Group;
model pol = Group;
lsmeans Group / pdiff adjust=tukey;
run;
Try the following:
proc glm data=mylib.'Sheet1$'n;
class Group;
model pol = Group;
lsmeans Group / pdiff adjust=tukey;
run;