I'm having difficulty figuring out the appropriate contrasts including an interaction term. In my model:
I would like to get a contrast equivalent to testing whether beta for var2 is not equal to 0, for each level of var1. var1 is binary and var2 has 4 levels, so the design variables in SAS are:
I can calculate the overall contrast for the beta of var2 not equal to 0:
And I think I correctly calculated the design variables for each level of the interaction:
But I'm not really sure how to get the correct contrast statement for testing whether the beta coefficient of var2 is not equal to 0, for each level of var1.
I tried for var1=1, but I don't think the contrast is correct:
Code:
proc logistic data=data;
class var1 var2;
y = var1 var2 var1*var2 / link=glogit;
Code:
class value Design Variables
var1 1 1
2 -1
var2 0 1 0 0
1 0 1 0
2 0 0 1
4 -1 -1 -1
Code:
contrast 'beta var2 ne 0' var2 0 1 1,
var2 0 0 1,
var2 1 1 0,
var2 1 -1 0,
var2 1 0 -1,
var2 0 1 -1;
Code:
class value Design Variables
var1*var2 0 1 0 0 0
var1*var2 1 0 1 0 0
var1*var2 2 0 0 1 0
var1*var2 4 0 0 0 1
var1*var2 8 -1 -1 -1 -1
I tried for var1=1, but I don't think the contrast is correct:
Code:
contrast 'beta var2 ne 0, var1=1' var1*var2 -1 0 0 1,
var1*var2 0 -1 0 1,
var1*var2 0 0 -1 1,
var1*var2 -1 0 1 0,
var1*var2 0 -1 1 0,
var1*var2 -1 1 0 0;