Announcement

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

  • Bootstrap the coefficient for the between-group difference from a generalised linear regression model

    Dear all,
    May I please ask for your help with my analysis? I did 1) the multiple imputations for one cost component, 2) calculate the total cost based on the imputed data, 3) run the glm on the imputed data, 4) bootstrap the coefficient for the between-group differences (where I am stuck now). Here are my codes:

    quietly mi passive: gen Cost_TOTAL_im=Cost_MEDICAL+Cost_NONMEDICAL

    cap prog drop misim

    program define misim, rclass
    mi estimate: glm Cost_TOTAL_im group, family(gamma) link(log) robust
    mimrgns group, atmeans pwcompare predict(mu)
    matrix list r(b_vs)
    matrix define C=r(b_vs)
    return scalar c1=C[1,1]
    end

    bootstrap c1=r(c1), rep(1000) seed (1234) strata(treatment_group) saving (bootstrap_MI, replace):misim


    I also tried the below code for bootstrapping, still does not work:

    cap prog drop misim

    program define misim, rclass
    mim: glm Cost_TOTAL_im group, family(gamma) link(log) robust
    matrix define C=e(MIM_Q)
    return scalar c1=C[1,1]
    end

    bootstrap c1=r(c1), rep(1000) seed (1234) strata(treatment_group) saving (bootstrap_MI, replace):misim


    Any help will be greatly appreciated.

    Thank you,
    Keira

  • #2
    I think that this approach is not valid and might give biased results. What you do is that you impute once and then resample from this imputed data multiple times. The valid way is to draw a random sample from the original data (so drawing missing values is fine), then impute and compute your results. This is, of course, computationally intense, since you need to impute each resample again. For more information see https://onlinelibrary.wiley.com/doi/10.1002/sim.7956 or https://thestatsgeek.com/2016/03/12/...le-imputation/
    Last edited by Felix Bittmann; 12 Jun 2022, 23:49.
    Best wishes

    Stata 18.0 MP | ORCID | Google Scholar

    Comment


    • #3
      Thank you very much Felix. I will have a look at the references you kindly provided.

      Comment

      Working...
      X