Hi,
I want to estimate the effect of combinations of BMI in childhood and adulthood. The effects are not linear, so I'm using the mkspline command with a knot at the median for child BMI and at 22 for adult BMI before doing stcox.
I now what the HRs for persons with specific combinations of BMI and have used lincom for this, but I'm not sure if I've done it correctly.
For instance, I want the risk for a child with af BMI at the 85th percentile and an adult BMI of 30. Is it then correct to use only the two coefficients for BMIs above the knots? and multiply these with the distance from the knot points? As done in the code below.
I want several point estimates. Is there a smatter way of getting these than repeating the lincom as I have done?
And what would be a smart way to save all these results?
META_ANALYSIS
I have IPD from several cohorts and want to do the mkspline, stcox and lincom as a meta-analysis using the metan command. I have run the stcox in each of the cohorts and saved the coeffcients using postfile.
I have also run a meta-analysis using the metan command, but I can only make it work on one estimate. Can the metan be used with several coefficients? Otherwise I cannot do the lincom, or can I?
When trying to run the metan with several coefficients I get this error: "Non integer cell counts found".
Could I do four separate meta-analysis and do lincom afterwards?
Many thanks
Lise
I want to estimate the effect of combinations of BMI in childhood and adulthood. The effects are not linear, so I'm using the mkspline command with a knot at the median for child BMI and at 22 for adult BMI before doing stcox.
I now what the HRs for persons with specific combinations of BMI and have used lincom for this, but I'm not sure if I've done it correctly.
For instance, I want the risk for a child with af BMI at the 85th percentile and an adult BMI of 30. Is it then correct to use only the two coefficients for BMIs above the knots? and multiply these with the distance from the knot points? As done in the code below.
I want several point estimates. Is there a smatter way of getting these than repeating the lincom as I have done?
And what would be a smart way to save all these results?
Code:
foreach var of numlist 7 { preserve drop if sexn==1 centile bmi`var', centile(50 75 85 95) return list local p50=r(c_1) local p75=r(c_2) local p85=r(c_3) local p95=r(c_4) display `p50' dis `p75' dis `p85' dis `p95' dis `p75'-`p50' dis `p85'-`p50' dis `p95'-`p50' mkspline x1_bmi`var' `p50' x2_bmi`var' =bmi`var' //median child BMI as the cut-off mkspline y1_bmi 22 y2_bmi=bmiadult xi:stcox x1_bmi`var' x2_bmi`var' y1_bmi y2_bmi, str(yy) lincom x1_bmi`var'*0.00001 + y1_bmi*0.00001, hr //BMI7=median og BMIadult=22 (ref) lincom x1_bmi`var'*0.00001 + y2_bmi*5, hr //BMI7=median og BMIadult=25 lincom x1_bmi`var'*0.00001 + y2_bmi*8, hr //BMI7=median og BMIadult=30 lincom x1_bmi`var'*0.00001 + y2_bmi*13, hr //BMI7=median og BMIadult=35 lincom x2_bmi`var'*(`p75'-`p50') + y1_bmi*0.00001, hr //BMI7=75th percentile og BMIadult=22 - correct? lincom x2_bmi`var'*(`p75'-`p50') + y2_bmi*5, hr //BMI7=75th percentile og BMIadult=25 lincom x2_bmi`var'*(`p75'-`p50') + y2_bmi*8, hr //BMI7=75th percentile og BMIadult=30 lincom x2_bmi`var'*(`p75'-`p50') + y2_bmi*13, hr //BMI7=75th percentile og BMIadult=35 lincom x2_bmi`var'*(`p85'-`p50') + y1_bmi*0.00001, hr //BMI7=85th percentile og BMIadult=22 - correct? lincom x2_bmi`var'*(`p85'-`p50') + y2_bmi*5, hr //BMI7=85th percentile og BMIadult=25 lincom x2_bmi`var'*(`p85'-`p50') + y2_bmi*8, hr //BMI7=85th percentile og BMIadult=30 lincom x2_bmi`var'*(`p85'-`p50') + y2_bmi*13, hr //BMI7=85th percentile og BMIadult=35 lincom x2_bmi`var'*(`p95'-`p50') + y1_bmi*0.00001, hr //BMI7=95th percentile og BMIadult=22 - correct? lincom x2_bmi`var'*(`p95'-`p50') + y2_bmi*5, hr //BMI7=95th percentile og BMIadult=25 lincom x2_bmi`var'*(`p95'-`p50') + y2_bmi*8, hr //BMI7=95th percentile og BMIadult=30 lincom x2_bmi`var'*(`p95'-`p50') + y2_bmi*13, hr //BMI7=95th percentile og BMIadult=35 restore }
META_ANALYSIS
I have IPD from several cohorts and want to do the mkspline, stcox and lincom as a meta-analysis using the metan command. I have run the stcox in each of the cohorts and saved the coeffcients using postfile.
I have also run a meta-analysis using the metan command, but I can only make it work on one estimate. Can the metan be used with several coefficients? Otherwise I cannot do the lincom, or can I?
When trying to run the metan with several coefficients I get this error: "Non integer cell counts found".
Could I do four separate meta-analysis and do lincom afterwards?
Code:
metan coef_CO se_CO coef_AO se_AO, eform random
Many thanks
Lise
Comment