Hello,
I am trying to run the following cycle in Stata:
levels clinic_code, local(clinic_code_levels)
foreach p of local clinic_code_levels {
levels month, local(month_levels)
foreach m of local month_levels {
conindex nr_events if clinic==`"p'"' & month==`m', rankvar(person_age) true zero generalized
noi disp "`p' `m': " ("r(CI)-1.96*r(CIse) ", " r(CI)+1.96*r(CIse) ")"
}
}
Right now I am able to see all the output in the main window, but I will end up with too many lines with the different clinics and months, almost close to 30k.
Does anyone know if it is possible to automatically insert those values into a new dataset like this:
Many thanks for your help.
I am trying to run the following cycle in Stata:
levels clinic_code, local(clinic_code_levels)
foreach p of local clinic_code_levels {
levels month, local(month_levels)
foreach m of local month_levels {
conindex nr_events if clinic==`"p'"' & month==`m', rankvar(person_age) true zero generalized
noi disp "`p' `m': " ("r(CI)-1.96*r(CIse) ", " r(CI)+1.96*r(CIse) ")"
}
}
Right now I am able to see all the output in the main window, but I will end up with too many lines with the different clinics and months, almost close to 30k.
Does anyone know if it is possible to automatically insert those values into a new dataset like this:
| Clinic `p' | Month `m' | concentration index r(CI) |
95% confidence interval (lower) r(CI)-1.96*r(CIse) |
95% confidence interval (upper) r(CI)+1.96*r(CIse) |
Many thanks for your help.

Comment