I am comparing mortality between two treatment groups using a Cox model. I want to assess for subgroup differences using an interaction term (between the treatment group and the subgroup) as a heterogeneity test.
Eg,:
When there appears to be a subgroup effect - like in the above example - I want to report the HR for the treatment group effect (ie, Arm A vs Arm B) at each of the subgroup levels (ie, at age <20 and age >=20).
I thought I was getting there, but I'm getting very muddled with the margins command that I need to run to give these HRs. Do you have any advice?
Is it the following:
Thank you in advance for any help!
Eg,:
Code:
. stcox randgroup##age_binary, allbase
Failure _d: death==1
Analysis time _t: day_eos
Exit on or before: time 168
Iteration 0: log likelihood = -743.21888
Iteration 1: log likelihood = -738.52467
Iteration 2: log likelihood = -736.31973
Iteration 3: log likelihood = -736.29266
Iteration 4: log likelihood = -736.29266
Refining estimates:
Iteration 0: log likelihood = -736.29266
Cox regression with Breslow method for ties
No. of subjects = 555 Number of obs = 555
No. of failures = 120
Time at risk = 76,776
LR chi2(3) = 13.85
Log likelihood = -736.29266 Prob > chi2 = 0.0031
--------------------------------------------------------------------------------------
_t | Haz. ratio Std. err. z P>|z| [95% conf. interval]
---------------------+----------------------------------------------------------------
randgroup |
Arm A | 1 (base)
Arm B | 2.820427 1.076045 2.72 0.007 1.33526 5.9575
|
age_binary |
<20 years | 1 (base)
>=20 years | 1.028425 .3618726 0.08 0.937 .5160121 2.049677
|
randgroup#age_binary |
Arm A#<20 years | 1 (base)
Arm A#>=20 years | 1 (base)
Arm B#<20 years | 1 (base)
Arm B#>=20 years | .3911957 .1710112 -2.15 0.032 .16607 .9215034
--------------------------------------------------------------------------------------
When there appears to be a subgroup effect - like in the above example - I want to report the HR for the treatment group effect (ie, Arm A vs Arm B) at each of the subgroup levels (ie, at age <20 and age >=20).
I thought I was getting there, but I'm getting very muddled with the margins command that I need to run to give these HRs. Do you have any advice?
Is it the following:
Code:
. margins randgroup#age_binary
Adjusted predictions Number of obs = 555
Model VCE: OIM
Expression: Predicted hazard ratio, predict()
--------------------------------------------------------------------------------------
| Delta-method
| Margin std. err. z P>|z| [95% conf. interval]
---------------------+----------------------------------------------------------------
randgroup#age_binary |
Arm A#<20 years | 1 . . . . .
Arm A#>=20 years | 1.028425 .3618726 2.84 0.004 .3191679 1.737682
Arm B#<20 years | 2.820427 1.076045 2.62 0.009 .7114179 4.929437
Arm B#>=20 years | 1.134702 .3959151 2.87 0.004 .3587222 1.910681
--------------------------------------------------------------------------------------

Comment