Hello,
I am attempting to write a bootstrap program that will save the marginal estimates of a multinomial logisitic regression. I would ultimately like my program to create a dataset that contains just the margin estimates obtained from each iteration of my bootstrap program. My current program will save the coefficient estimates for each iteration, but not the margin estimates. Any suggestions on how to achieve that would be helpful.
I am using a complex survey dataset, the Medical Expenditure Panel Survey, in stata 13.1. My outcome is a four-level categorical variable and my exposure variables are year and income level. The (simplified) code I have written is below:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
program savemargins, rclass
svyset varpsu [pweight=perwt], strata(varstr) psu(varpsu)
svy, subpop(subpop): mlogit outcome i.income##c.year
margins, at [specified levels] predict(outcome(1))
matrix list r(b)
end
bootstrap, saving(margins) reps(200): savemargins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thank you for your help.
Best,
Doug
I am attempting to write a bootstrap program that will save the marginal estimates of a multinomial logisitic regression. I would ultimately like my program to create a dataset that contains just the margin estimates obtained from each iteration of my bootstrap program. My current program will save the coefficient estimates for each iteration, but not the margin estimates. Any suggestions on how to achieve that would be helpful.
I am using a complex survey dataset, the Medical Expenditure Panel Survey, in stata 13.1. My outcome is a four-level categorical variable and my exposure variables are year and income level. The (simplified) code I have written is below:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
program savemargins, rclass
svyset varpsu [pweight=perwt], strata(varstr) psu(varpsu)
svy, subpop(subpop): mlogit outcome i.income##c.year
margins, at [specified levels] predict(outcome(1))
matrix list r(b)
end
bootstrap, saving(margins) reps(200): savemargins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thank you for your help.
Best,
Doug
Comment