Hi,
I am using Stata 16.1
I am analysing in a longitudinal study the associations between blood pressure (BP) level at baseline and mortality. I first have used a classic Cox model with a categorical BP variable (for systolic BP : ]90, [90-99[, ...[130-139[, ...).
I have obtained hazard ratios for each of the 7 values of this categorical variable). As expected, there are significant increases in HR for the lowest levels of BP and for the highest levels of BP (as compared to mid-range BP).
Now, I would like obtain a plot between systolic BP at baseline (as a continuous variable on x axis) and the predicted hazard ratio of mortality on y axis. Flexible parametric model seems to be the way to get it and I tried it with stpm2.
The continuous variable for BP is called PAS_moy, dureeOBSj if the time variable, DC2==1 is the living status (categorical)
my code is :
#
stset dureeOBSj, failure(DC2==1) scale(1)
stpm2 PAS_moy , scale(hazard) df(3) eform
predict hr_PS, hazard ci
/
When I plot with :
#
twoway (qfit hr_PS PAS_moy, lcolor(black) msymbol(point)) (qfit hr_PS_lci PAS_moy, lcolor(gray) lpattern(dash)) (qfit hr_PS_uci PAS_moy, lcolor(gray) lpattern(dash))
/
I obtain a nice graph with a U type curve as expected,.. But, ... the Y axis indicates "fiited values" ranging between 0.0008 and 0.0040, instead of hazard ratio estimate (in the Cox analysis they varied from 2.4 to 1.3, with the reference being the category 130-139).
I did not find how to get them on the flexible parametric model despite carefull reading of help and ressources. I suppose I miss something to define the predictied hr.
Will I get a little help from my friends ?
Joel
I am using Stata 16.1
I am analysing in a longitudinal study the associations between blood pressure (BP) level at baseline and mortality. I first have used a classic Cox model with a categorical BP variable (for systolic BP : ]90, [90-99[, ...[130-139[, ...).
I have obtained hazard ratios for each of the 7 values of this categorical variable). As expected, there are significant increases in HR for the lowest levels of BP and for the highest levels of BP (as compared to mid-range BP).
Now, I would like obtain a plot between systolic BP at baseline (as a continuous variable on x axis) and the predicted hazard ratio of mortality on y axis. Flexible parametric model seems to be the way to get it and I tried it with stpm2.
The continuous variable for BP is called PAS_moy, dureeOBSj if the time variable, DC2==1 is the living status (categorical)
my code is :
#
stset dureeOBSj, failure(DC2==1) scale(1)
stpm2 PAS_moy , scale(hazard) df(3) eform
predict hr_PS, hazard ci
/
When I plot with :
#
twoway (qfit hr_PS PAS_moy, lcolor(black) msymbol(point)) (qfit hr_PS_lci PAS_moy, lcolor(gray) lpattern(dash)) (qfit hr_PS_uci PAS_moy, lcolor(gray) lpattern(dash))
/
I obtain a nice graph with a U type curve as expected,.. But, ... the Y axis indicates "fiited values" ranging between 0.0008 and 0.0040, instead of hazard ratio estimate (in the Cox analysis they varied from 2.4 to 1.3, with the reference being the category 130-139).
I did not find how to get them on the flexible parametric model despite carefull reading of help and ressources. I suppose I miss something to define the predictied hr.
Will I get a little help from my friends ?
Joel
Comment