Hi,
I’m analyzing how the associations between categories of Body Mass Index and the risk of all-cause mortality vary across age. To this purpose, I'm using age as the time-scale, STPM2 to create flexible parametric survival models, and predict to estimate the hazard ratio variations across the age range 45 to 85 years old. Then, I plot the restricted cubic splines.
I am wondering if, after fitting the STPM2 model with the covariates, including/not including the covariates in the predict command is necessary (and why / why not). I have this question because I tried running the predict part with and without including covariates, previously included in the STPM2 command, and this yielded the same results in all the splines, across all BMI categories (overweight vs normal weight, obese vs normal weight, etc).
I paste below an extract of my code to analyze all-cause mortality hazard ratios for the overweight versus the normal weight (reference), with some covariates. Some additional info:
Code:
// Stset for all-cause mortality, with age as the time-scale[INDENT=3]stset end_follow_up , failure( mortstat ==1) origin(time birth_day) enter(time assessment_date+(5*365.25)) scale(365.25)[/INDENT]
// Flexible parametric survival model
stpm2 bmi4cat2 bmi4cat3 bmi4cat4 ///
sex2 ///
ethnicity2 ethnicity3 ethnicity4 ///
educ2 educ3 ///
physical_activity ///
, scale(hazard) df(2) eform tvc(bmi4cat2 bmi4cat3 bmi4cat4) dftvc(2)
// Option 1 - Predicting Overweight vs normal weight (reference) hazard ratio with covariates
predict hr_bmi1, ///
hrnumerator (bmi4cat2 1 sex1 1 ethnicity1 1 educ1 1 total_pa 1886.0) ///
hrdenominator(bmi4cat1 1 sex1 1 ethnicity1 1 educ1 1 total_pa 1886.0) ///
ci timevar(t2)
// Option 2 - The same but without including covariates (same results as option 1)
predict hr_bmi1, ///
hrnumerator (bmi4cat2 1 sex1 1 ethnicity1 1 educ1 1 total_pa 1886.0) ///
hrdenominator(bmi4cat1 1 sex1 1 ethnicity1 1 educ1 1 total_pa 1886.0) ///
ci timevar(t2)
Many thanks!
I’m analyzing how the associations between categories of Body Mass Index and the risk of all-cause mortality vary across age. To this purpose, I'm using age as the time-scale, STPM2 to create flexible parametric survival models, and predict to estimate the hazard ratio variations across the age range 45 to 85 years old. Then, I plot the restricted cubic splines.
I am wondering if, after fitting the STPM2 model with the covariates, including/not including the covariates in the predict command is necessary (and why / why not). I have this question because I tried running the predict part with and without including covariates, previously included in the STPM2 command, and this yielded the same results in all the splines, across all BMI categories (overweight vs normal weight, obese vs normal weight, etc).
I paste below an extract of my code to analyze all-cause mortality hazard ratios for the overweight versus the normal weight (reference), with some covariates. Some additional info:
- BMI (the exposure) has 4 categories (Normal weight, Overweight, Obese class I and Obese class II), and dummies were created accordingly (bmi4cat*).
- Ethnicity has 4 categories (2 dummies per category, ethnicity*)
- Physical_activity (total levels of weekly physical activity) is continuous (I included the median for the adjustment)
- The time variable (t2) was coded as "range t2 45 85 100".
Code:
// Stset for all-cause mortality, with age as the time-scale[INDENT=3]stset end_follow_up , failure( mortstat ==1) origin(time birth_day) enter(time assessment_date+(5*365.25)) scale(365.25)[/INDENT]
// Flexible parametric survival model
stpm2 bmi4cat2 bmi4cat3 bmi4cat4 ///
sex2 ///
ethnicity2 ethnicity3 ethnicity4 ///
educ2 educ3 ///
physical_activity ///
, scale(hazard) df(2) eform tvc(bmi4cat2 bmi4cat3 bmi4cat4) dftvc(2)
// Option 1 - Predicting Overweight vs normal weight (reference) hazard ratio with covariates
predict hr_bmi1, ///
hrnumerator (bmi4cat2 1 sex1 1 ethnicity1 1 educ1 1 total_pa 1886.0) ///
hrdenominator(bmi4cat1 1 sex1 1 ethnicity1 1 educ1 1 total_pa 1886.0) ///
ci timevar(t2)
// Option 2 - The same but without including covariates (same results as option 1)
predict hr_bmi1, ///
hrnumerator (bmi4cat2 1 sex1 1 ethnicity1 1 educ1 1 total_pa 1886.0) ///
hrdenominator(bmi4cat1 1 sex1 1 ethnicity1 1 educ1 1 total_pa 1886.0) ///
ci timevar(t2)
Many thanks!
Comment