Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to estimate, save and do meta-analysis on linear combination of coefficiens from non-linear associations using lincom

    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?


    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




  • #2
    You didn't get a quick answer. You may find that your long code and complex question resulted in no one else responding. It is often good to simplify to the minimum necessary to demonstrate your problem.

    I'm not sure why you're using lincom for predicted values at specific values of iv's - margins is usually easier. You can also usually estimate splines using factor variable notation which then facilitates using margins. I'm also not sure that your lincom calculations are right when you have a non-linear estimator.

    I'm also not sure why you go to a meta analysis. Meta analysis normally applies when you have only summary statistics. If you have the full data, you can to a common model across cohorts (allowing parameters to vary by cohort).

    Comment


    • #3
      Hi Phil,

      Thanks for answering. I realised that my question was too complex.
      Apoligies for my late reply. I didn't see your answer until now.

      I wanted to use lincom, since this was a method I knew, but I might consider to use margins. I haven't used that before. Thanks for the suggestion.

      I do not have access to all data (my collaborators are doing the analysis on some cohorts), so for these I will only have summary statistics, but defined the way I want it.
      Since I can only do meta-analyis over one estimate at a time, I am thinking to do the prediction (using lincom or margins) in each of the cohorts and pool these afterwards in a meta-analysis.

      Comment

      Working...
      X