That should not present a problem - once again it is why LSMESTIMATE statements are so useful.
lsmeans vaper|riagender/e;
lsmestimate riagender "Males vs Females, averaged over vaper status' -1 1/exp;
lsmestimate vaper*riagender 'Males vs Females, vaper status=never' -1 1 0 0 0 0,
'Males vs Females, vaper status=former' 0 0 -1 1 0 0,
'Males vs Females, vaper status=current' 0 0 0 0 -1 1/exp;
This now gets trickier. I just stuck these in, and the correct version depends on the ordering of vaper levels. Since there is nothing in the CLASS statement and I assume that the levels are in fact 'Current', 'Former', and 'Never', the lsmeans will sort in alphabetical order. That means the code should look like:
lsmeans vaper|riagender/e;
lsmestimate riagender "Males vs Females, averaged over vaper status' -1 1/exp;
lsmestimate vaper*riagender 'Males vs Females, vaper status=current' -1 1 0 0 0 0,
'Males vs Females, vaper status=former' 0 0 -1 1 0 0,
'Males vs Females, vaper status=never' 0 0 0 0 -1 1/exp;
If there is another coding for the vaper levels, it can be handled once you know the order that things appear in the LSMEANS statement.
SteveDenham.
... View more