Hello,
I'm running a cox regression with an interaction term and faced an issue.
I ran a cox regression using "stcox" and examined for any time varying covariates using "estat phtest, detail" and selected those variables required and added them into the "tvc()" option.
However, the issue I have is that my interaction effect term goes against the ph assumption.
I was unable to find any other solution to this so added the interaction term into the "tvc()" option along with the other independent variables.
My questions are,
1. is it correct to add the interaction term into the "tvc()" option?
2. once included how can I interpret the output?
I have listed the codes and the process I followed below. Kindly let me know if I've made any mistakes in posting on the board as I'm relatively new here.
Thanks.
Below are my codes:
Step 1. I first ran the cox regression
My interaction term here is:
Step 2. Then I examined for time varying covariates
The result for the ph test for my interaction term was:
Step 3. I used the "tvc()" option to adjust for the time varying covariates
Result
I'm running a cox regression with an interaction term and faced an issue.
I ran a cox regression using "stcox" and examined for any time varying covariates using "estat phtest, detail" and selected those variables required and added them into the "tvc()" option.
However, the issue I have is that my interaction effect term goes against the ph assumption.
I was unable to find any other solution to this so added the interaction term into the "tvc()" option along with the other independent variables.
My questions are,
1. is it correct to add the interaction term into the "tvc()" option?
2. once included how can I interpret the output?
I have listed the codes and the process I followed below. Kindly let me know if I've made any mistakes in posting on the board as I'm relatively new here.
Thanks.
Below are my codes:
Step 1. I first ran the cox regression
Code:
stcox i.gender age_cr i.marr_n i.edu edu_pa i.form_pa i.income_gr_r i.comtype_n i.job_cat i.size2 i.size3 i.region wage_gr worktime i.source i.source#i.income_gr_r if form==1, nolog nohr vce(cluster sampid)
Code:
i.source#i.income_gr_r
Code:
estat phtest, detail
Code:
Test of proportional-hazards assumption Time: Time ---------------------------------------------------------------- | rho chi2 df Prob>chi2 ------------+--------------------------------------------------- 0b.source#~r| . . 1 . 0b.source#~r| . . 1 . 0b.source#~r| . . 1 . 1o.source#~r| . . 1 . 1.source#2~r| -0.01688 0.57 1 0.4499 1.source#3~r| -0.06321 9.07 1 0.0026
Code:
stcox i.gender age_cr i.marr_n i.edu edu_pa i.form_pa i.income_gr_r i.comtype_n i.job_cat i.size2 i.size3 i.region wage_gr worktime i.source i.source#i.income_gr_r if form==1, nolog nohr vce(cluster sampid) tvc(i.gender age_cr i.marr_n edu_pa i.job_cat wage_gr i.source#i.income_gr_r)
Code:
failure _d: change == 1 analysis time _t: stop_g exit on or before: time . id: sampid Cox regression -- Breslow method for ties No. of subjects = 3,491 Number of obs = 4,368 No. of failures = 1,929 Time at risk = 154216 Wald chi2(46) = 1340.14 Log pseudolikelihood = -12878.848 Prob > chi2 = 0.0000 (Std. Err. adjusted for 3,491 clusters in sampid) ------------------------------------------------------------------------------------ | Robust _t | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------------+---------------------------------------------------------------- main | 2.gender | -.4431066 .0949016 -4.67 0.000 -.6291103 -.2571029 age_cr | -.0313461 .0164819 -1.90 0.057 -.06365 .0009578 1.marr_n | -1.010725 .1327421 -7.61 0.000 -1.270894 -.7505549 | edu | 2 | .0264575 .0684341 0.39 0.699 -.1076708 .1605858 3 | .1271726 .0725084 1.75 0.079 -.0149413 .2692865 | edu_pa | -.006407 .0147114 -0.44 0.663 -.0352409 .0224269 1.form_pa | .0209957 .047208 0.44 0.657 -.0715303 .1135217 | income_gr_r | 2 | .2850941 .1108405 2.57 0.010 .0678507 .5023376 3 | .1893827 .1479515 1.28 0.201 -.1005968 .4793623 | 1.comtype_n | .5158948 .0961778 5.36 0.000 .3273898 .7043998 | job_cat | 1 | -.0275108 .1266858 -0.22 0.828 -.2758105 .2207888 2 | -.3652914 .1282001 -2.85 0.004 -.616559 -.1140239 3 | -.1030574 .1343132 -0.77 0.443 -.3663064 .1601916 4 | .0538833 .1721741 0.31 0.754 -.2835718 .3913383 5 | .0940228 .1502597 0.63 0.531 -.2004808 .3885265 6 | -.4941672 .1567611 -3.15 0.002 -.8014133 -.186921 7 | -.0415263 .6525417 -0.06 0.949 -1.320485 1.237432 8 | -.4924015 .1495981 -3.29 0.001 -.7856083 -.1991946 9 | .1907758 1.500997 0.13 0.899 -2.751124 3.132676 | 1.size2 | .018672 .0594922 0.31 0.754 -.0979307 .1352746 1.size3 | .0297716 .0610715 0.49 0.626 -.0899263 .1494695 1.region | .0353711 .0495305 0.71 0.475 -.061707 .1324492 wage_gr | -1.044532 .0630823 -16.56 0.000 -1.168171 -.9208935 worktime | .0226867 .00322 7.05 0.000 .0163757 .0289977 1.source | .2084912 .1313705 1.59 0.113 -.0489903 .4659726 | source#income_gr_r | 1 2 | -.1215072 .1673016 -0.73 0.468 -.4494124 .2063979 1 3 | .2565586 .2646868 0.97 0.332 -.2622179 .7753351 -------------------+---------------------------------------------------------------- tvc | 2.gender | .0030807 .0014135 2.18 0.029 .0003103 .005851 age_cr | .0006733 .0002153 3.13 0.002 .0002513 .0010954 1.marr_n | .0043274 .0015735 2.75 0.006 .0012434 .0074114 edu_pa | .0004625 .0002071 2.23 0.026 .0000565 .0008685 | job_cat | 1 | .0031691 .0019483 1.63 0.104 -.0006496 .0069877 2 | .0054766 .0018022 3.04 0.002 .0019444 .0090088 3 | .004783 .0019121 2.50 0.012 .0010353 .0085307 4 | .0030819 .0028713 1.07 0.283 -.0025456 .0087095 5 | .0027282 .0023817 1.15 0.252 -.0019398 .0073963 6 | .0045121 .0020554 2.20 0.028 .0004837 .0085406 7 | -.0041726 .009211 -0.45 0.651 -.0222258 .0138807 8 | .003698 .0021001 1.76 0.078 -.0004181 .0078141 9 | .0329873 .0271745 1.21 0.225 -.0202738 .0862483 | wage_gr | .0034141 .0008392 4.07 0.000 .0017693 .0050589 | source#income_gr_r | 0 2 | -.0028383 .0015357 -1.85 0.065 -.0058482 .0001715 0 3 | .0028599 .0021451 1.33 0.182 -.0013444 .0070642 1 1 | -.0008861 .0017877 -0.50 0.620 -.0043898 .0026177 1 2 | -.0045665 .0017349 -2.63 0.008 -.0079669 -.0011661 1 3 | -.010152 .0038855 -2.61 0.009 -.0177674 -.0025366 ------------------------------------------------------------------------------------ Note: Variables in tvc equation interacted with _t.