Hi all,
I am estimating a two-part model (twopm) and want to store the margins estimates with the correct bootstrap standard errors - to later plot several models combined in a combomarginsplot.
Here is an example of what I am trying to do, what should I change in my code so it will store it correctly?:
Much appreciated,
Alon
I am estimating a two-part model (twopm) and want to store the margins estimates with the correct bootstrap standard errors - to later plot several models combined in a combomarginsplot.
Here is an example of what I am trying to do, what should I change in my code so it will store it correctly?:
Code:
program define dydx_boot, eclass qui twopm y i.age if female==0, firstpart(logit) second part(regress, log) vce(cluster id) qui margins, at(age=(21(1)42)) predict(duan) post nose end bootstrap _b, saving(male, replace) seed(14) reps(1000):dydx_boot capture program drop dydx_boot program define dydx_boot, eclass qui twopm y i.age if female==1, firstpart(logic) second part(regress, log) vce(cluster id) qui margins, at(age=(21(1)42)) predict(duan) post nose end bootstrap _b, saving(female, replace) seed(14) reps(1000):dydx_boot combomarginsplot male female
Much appreciated,
Alon
Comment