- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is there an option in LSMEANS of PROC GLM which will compute pairwise p-values?
In my program, the variable 'surgery' has 15 categories. I want to see pairwise differences & p-values between them all. I am trying to avoid writing many estimate statements.
proc glm data=ads;
class surgery ;
model event=surgery/solution ss3;;
lsmeans surgery / cl adjust=tukey stderr pdiff tdiff ;
means surgery / tukey alpha=0.05 cldiff;
I can get the differences but not the p-values I want.
I'm trying to see if I can get the p-value from such an estimate statement, without typing out each comparison. I'm interested in the p-value from each comparison, not accounting for others.
estimate 'surgery 1 vs 2' surgery 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 ;
estimate 'surgery 2 vs 1' surgery -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 ;
run;
quit;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Do you get something similar to this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I do, but why do these p-values not match what I get if I write out contrast statments?
I.e. these are the comparison p-values I want.
estimate 'surgery 1 vs 2' surgery 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 ;
estimate 'surgery 2 vs 1' surgery -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 ;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
They don't match because the LSMEANS comparisons uses Tukey adjustments to the p-values (that's what your code asked for), but your estimate statements have no such adjustment.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you do not want to adjust for experiment-wise Type I error, then remove "adjust=tukey" from the LSMEANS statement (while keeping in mind that there are 105 pairwise comparisons among 15 means, and only 14 degrees of freedom).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! This does not give the p-value for each comparison though? Is there a way to get each p-value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The p-value is the bottom number in each cell of the table.
Paige Miller