08-09-2017 02:59 AM
I am just wondering if there is a mistake with the attached code since the class level information for sex is female = 0 and male = 1, the first part of the code is contrasting different groups in males and the value used was zero. Should it not be 1 instead?. Can some explain how the contrast statement works in an interaction?
08-09-2017 05:09 AM
08-09-2017 11:06 AM - edited 08-09-2017 11:10 AM
If you want to make simple pairwise comparisons, it is always easiest to use the LSMEANS, LSMESTIMATE, or SLICE statement since this allows you to avoid the always error-prone process of determining contrast coefficients for the CONTRAST or ESTIMATE statement. This is discussed and illustrated in detail in this note. For a model with interaction, you can use the SLICE statement to simplify getting your comparisons.
08-10-2017 08:58 PM
I am testing an interaction between two categorical variables; the first variable has 5 levels and the other has 4. However, I just want to contrast some levels of this interaction and obtain an overall p-value for those interaction terms being contrasted. Is that possible? if so how?
Any help would be appreciated.
08-11-2017 11:56 AM
The note I referred to shows exactly the sort of comparisons you seem to want in your original post. Please look over the examples. The SLICE, LSMEANS, and LSMESTIMATE statements work the same way in any modeling procedure that supports them.
slice group*sex / sliceby=sex;
slice group*sex / sliceby=group;
Note that you need to use PARAM=GLM (not REF) in the CLASS statement to use SLICE, LSMEANS, or LSMESTIMATE. See the documentation of the SLICE and LSMEANS statements in your modeling procedure to see the additional options that are available.