Using the code below, I am trying to obtain and save marginal estimates for each iteration of my multinomial logisitic regression. I am getting the error: "an error occurred when svy executed mlogit: option baseoutcome() is required with prefix svy bootstrap". How can I fix this?
Thanks,
NM
set more off
use http://www.stata-press.com/data/r14/nhanes2f, clear
svyset psuid [pweight=finalwgt], strata(stratid) psu(psuid)
capture program drop savemargins
program savemargins, rclass
svy, subpop(race): mlogit health i.agegrp##c.zinc
margins, at(zinc=(0 10)) predict(outcome(1)) post
end
bootstrap _b, saving(margins, replace) reps(200): savemargins
use http://www.stata-press.com/data/r14/nhanes2f, clear
svyset psuid [pweight=finalwgt], strata(stratid) psu(psuid)
capture program drop savemargins
program savemargins, rclass
svy, subpop(race): mlogit health i.agegrp##c.zinc
margins, at(zinc=(0 10)) predict(outcome(1)) post
end
bootstrap _b, saving(margins, replace) reps(200): savemargins
0 Response to an error occurred when svy executed mlogit: option baseoutcome() is required with prefix svy bootstrap
Post a Comment