I'm trying to figure out how SAS calculates the per level estimates using contrast statements, as well as the predicted survival per person in a survival model with an interaction coefficient. For example, I'm trying to predict an outcome from bmi, a binary categorical variable (1 vs. 2), a binary covariate (0 vs. 1), and an interaction term (bmi_lvl=bmi*lvl). Here's the data: data temp;
input ID foltime bmi cov lvl bmi_lvl outcome;
datalines;
1 1.2 20 0 2 40 1
2 0.5 23 1 2 46 1
3 4.5 30 0 1 30 0
4 3.6 18 0 2 36 0
5 1.0 25 0 1 25 1
6 1.2 22 0 1 22 1
7 4.0 26 1 2 52 0
8 3.3 26 0 1 26 1
9 0.8 24 1 2 48 0
10 1.2 32 0 2 64 0
11 3.0 22 1 2 44 1
12 3.3 23 1 2 46 1
13 1.0 30 0 1 30 0
14 1.8 36 0 2 72 1
15 0.9 25 1 2 50 1
;
run; I plug it into the model: proc phreg data=temp outest=beta;
class cov (ref='0');
model foltime*outcome(0)=bmi lvl cov bmi_lvl/ties=efron RL;
*output statement provides the per person estimated survival;
output out=pred survival=survpred;
*contrast statement provides hazard estimates at specific BMI and level, at reference category for covariate;
*contrasting hazard at BMI 24 for levels 1 and 2;
contrast "lvl 1 at bmi 24" lvl 1 bmi 0 cov 0 bmi_lvl 24/estimate=exp e;
contrast "lvl 2 at bmi 24" lvl 2 bmi 0 cov 0 bmi_lvl 48/estimate=exp e;
*contrasting hazard at BMI 28 for levels 1 and 2;
contrast "lvl 1 at BMI 28" lvl 1 bmi 0 cov 0 bmi_lvl 28/estimate=exp e;
contrast "lvl 2 at BMI 28" lvl 2 bmi 0 cov 0 bmi_lvl 56/estimate=exp e;
run; I set BMI to 0 in the contrast statement based on example 2, page 10 of this paper, https://support.sas.com/resources/papers/proceedings10/253-2010.pdf, however, I'm not sure why that is. The coefficients are -0.8357 for BMI, -11.398 for lvl, 0.4375 for cov, and 0.4345 for bmi_lvl. Attached are the results for the contrast statements, as well as the per person estimated survival. How does SAS calculate these? Thanks!
... View more