I am tasked with building tables of output for our website using survey data. Each indicator we show (example, % of current smokers) is also shown by a serious of crosstabs such as by sex, age group, income, education, immigrant status and ethnicity. I have over a hundred indicators that need to be run and placed in tables to post to our website. I am trying to automate this as much as possible. In our table we show the percent, 95% CI and weighted population estimate. The CV and cell counts (obs) are used to determine if the statistic can be released. I use a formula in excel to convert a statistic to "NR" for not releasable or an * is placed beside the value to indicate it should be used with caution. Would love to find a way to do this inside STATA.
The survey data I am using has bootstrap weights and I cannot figure out how to export the CI's into excel. The syntax below works for another survey I used where we don't bootstrap and the CI's export. But when I used bootstrap weights the columns are generated in excel but the cells are blank. I believe this has something to do with those values not being kept in the memory.
I am not a programmer so this does not come easy to me. Does anyone have any suggestions? Bonus points if you know an easy way to include the counts in the same table. This syntax exports the counts in a table below.
Many thanks,
Suzanne
*overall
estpost svy, subpop(peel):tab SED1, per cv ci obs
estout using "K:\Health Services\Epidemiology\Health Status Data\STATA\Peel2015.xls", ///
cells("obs b(label(percent)) lb ub se(label(CV))") ///
label unstack transform(@ 1/@) title (Weekly Hours Sedentary Activity excludes reading, Peel)append
estpost svy, subpop(peel):tab SED1, count format(%11.0fc)
estout using "K:\Health Services\Epidemiology\Health Status Data\STATA\Peel2015.xls", ///
cells("obs b(label(estimate))") label unstack append
*By Sex
estpost svy, subpop(peel): tab SED1 dhh_sex, per col cv ci obs
estout using "K:\Health Services\Epidemiology\Health Status Data\STATA\Peel2015.xls", ///
cells("obs b(label(percent)) lb ub se(label(CV))") ///
label transform(@ 1/@) title (Weekly Hours Sedentary Activity excludes reading by Sex, Peel) append
estpost svy, subpop(peel): tab SED1 dhh_sex, count format(%11.0fc)
estout using "K:\Health Services\Epidemiology\Health Status Data\STATA\Peel2015.xls", ///
cells("obs b(label(estimate))") label unstack append
The survey data I am using has bootstrap weights and I cannot figure out how to export the CI's into excel. The syntax below works for another survey I used where we don't bootstrap and the CI's export. But when I used bootstrap weights the columns are generated in excel but the cells are blank. I believe this has something to do with those values not being kept in the memory.
I am not a programmer so this does not come easy to me. Does anyone have any suggestions? Bonus points if you know an easy way to include the counts in the same table. This syntax exports the counts in a table below.
Many thanks,
Suzanne
*overall
estpost svy, subpop(peel):tab SED1, per cv ci obs
estout using "K:\Health Services\Epidemiology\Health Status Data\STATA\Peel2015.xls", ///
cells("obs b(label(percent)) lb ub se(label(CV))") ///
label unstack transform(@ 1/@) title (Weekly Hours Sedentary Activity excludes reading, Peel)append
estpost svy, subpop(peel):tab SED1, count format(%11.0fc)
estout using "K:\Health Services\Epidemiology\Health Status Data\STATA\Peel2015.xls", ///
cells("obs b(label(estimate))") label unstack append
*By Sex
estpost svy, subpop(peel): tab SED1 dhh_sex, per col cv ci obs
estout using "K:\Health Services\Epidemiology\Health Status Data\STATA\Peel2015.xls", ///
cells("obs b(label(percent)) lb ub se(label(CV))") ///
label transform(@ 1/@) title (Weekly Hours Sedentary Activity excludes reading by Sex, Peel) append
estpost svy, subpop(peel): tab SED1 dhh_sex, count format(%11.0fc)
estout using "K:\Health Services\Epidemiology\Health Status Data\STATA\Peel2015.xls", ///
cells("obs b(label(estimate))") label unstack append