- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 05-11-2024 06:42 PM
(882 views)
I am trying to analyze a dataset that has two dichotomous variables (placstat and hiv) predicting a continuous variable (lplacwbc). The data are unbalanced. I am interested in seeing a matrix for pairwise comparisons, with p values, for all possible comparisons. The following code yields the output provided (not showing the model output, only lsmeans output). I may be missing something simple here, but I cannot figure it out!
proc glm;
class placstat hiv;
model lplacwbc=placstat hiv placstat*hiv/ ss1 ss2 ss3 ss4;
lsmeans placstat hiv/pdiff=all adjust=tukey;
run;
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
To add the pairwise comparisons and p-values for the interaction term, change your LSMEANS statement to this:
lsmeans placstat hiv placstat * hiv / pdiff=all adjust=tukey;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Perfect. So simple and it eluded me! Thanks!