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
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

Comment