Categories

# Custom hypothesis testing with Contrast statement in SAS

I have a model that is looking at the impact of a policy exposure, exposure period, and race on surgery rates. Each of the first three variables (exposure=E, period=P, and race=R) are dichotomous (0/1) variables. My regression equation is:

y = b(0) + b1P + b2E + b3R + b4EP + b5PR + b6ER + b7PER.

I am interested in looking at the differential effect of exposure on white vs. non-white patients. The effect on whites should be (b2 + b4), for non-whites should be (b2 + b4 + b6 + b7). Therefore, the differential effect should be (b6 + b7). In my model, this would correspond to the coefficients for exposurerace + periodexposure*race. My equation is therefore:

proc genmod data=simulation;
class expansion (ref=’0′) period (ref=’0′) race (ref=’0′);
model y= expansion period race expansionperiod expansionrace periodrace expansionperiod*race;
run;

I am trying to construct a custom Contrast statement to specify the "b6 + b7" terms. I have found that the following statement correctly specifies the coefficient for b7 (i.e. EPR). This is obtained by taking (1, -1) * (1, -1) * (1, -1)

contrast ‘expansion:race + period:expansion:race = 0’ expansionperiodrace
1 -1 -1 1 -1 1 1 -1;

In order to specify b6 + b7, I need to specify the contrast for b6 (i.e. ER). I would have thought this should just be (1,-1) (1,-1) = 1 -1 -1 1. However, this is incorrect as I can see it gives the wrong p-value compared to the model coefficient. Can anyone see what I am missing here? Thank you!