Hi
I'am trying to obtain margins after MI estimate and test differences between each slopes by a group . I have read that we need to use mimrgns. however after a piecewise mixed model I don't know how to do that. I have a code to do that just for non imputed data. See below. I replace "margins" by "mimrgns" but the saving option is not compatible. how can I obtain all estimates in order to plot the graph???
thanks a lot
carole
forvalues t = 1/5 {
local at`t'
forvalues i = 1/4 {
summ time`i' if Time == `t', meanonly
local at`t' `at`t'' time`i' = `r(mean)'
}
display "at(`at`t'')"
}
tempfile results
margins porteur, at(`at1') at(`at2') at(`at3') at(`at4') at(`at5') saving(`results')
use `results', clear
keep _m1 _at _margin _ci*
rename _margin dep
rename _at time
reshape wide dep _ci*, i(time) j(_m1)
label var dep0 "Non-porteur"
label var dep1 "Porteur"
graph twoway (connect dep* time) (rcap _ci_lb0 _ci_ub0 time, legend(off)) ///
(rcap _ci_lb1 _ci_ub1 time, legend(off))
0 Response to Mimrgns
Post a Comment