Dear all,
I'm using Stata (version 17.0) for the first time to get through the statistics for my master thesis. It went well but now I got stuck with including two variables with confidence intervalls into my graph. It would be greatly appreciated, if anyone could help me with this.
What's the issue: I'm trying to create a graph similar to the one below with red and blue bars, but with 95%-confidence intervalls included. Achieving 1-3 at the same time has so far been impossible for me.
This is the structure that I want to produce, but I'm struggeling at doing this with confidence intervalls.

I've tried about any option I was able to find and understand. These are the results I've produced so far, maybe there's something in it which only needs small adaption:
Using cibar, I did get the confidence intervalls but not for 2 variables

Using ciplot, I'm quite close to the result I'd like to have, but without the bars.

Using coefplot (sorry for the messed up labelling) bars and confidence intervalls are there, but I didn't find a way to do the sorting as needed.

Please let me know if you need more context or information and thanks a lot for your help with this!
Lina
I'm using Stata (version 17.0) for the first time to get through the statistics for my master thesis. It went well but now I got stuck with including two variables with confidence intervalls into my graph. It would be greatly appreciated, if anyone could help me with this.
What's the issue: I'm trying to create a graph similar to the one below with red and blue bars, but with 95%-confidence intervalls included. Achieving 1-3 at the same time has so far been impossible for me.
- The graph needs to include 2 variables CFCindex (CFCindivtotaldayexpenditure) and extv (external_values), which are both of monetary valus.
- I need confidence intervalls.
- The variables are supposed to be grouped by location (BI03bWardname), so that values are directly comparable.
This is the structure that I want to produce, but I'm struggeling at doing this with confidence intervalls.
Code:
graph bar CFCindvex extv, over(BI03bWardname)
I've tried about any option I was able to find and understand. These are the results I've produced so far, maybe there's something in it which only needs small adaption:
Using cibar, I did get the confidence intervalls but not for 2 variables
Code:
cibar CFCindvex, over (BI03bWardname)
Using ciplot, I'm quite close to the result I'd like to have, but without the bars.
Code:
ciplot CFCindvex extv, by(ward_numeric) vertical
Using coefplot (sorry for the messed up labelling) bars and confidence intervalls are there, but I didn't find a way to do the sorting as needed.
Code:
estimates clear local list foreach v of varlist CFCindvex external_values { qui: mean `v', over(ward_numeric) estimates store e_`v' } coefplot e_CFCindvex e_external_values, vertical recast(bar) citop fint(*.95) graphr(c(white)) nooffset
Please let me know if you need more context or information and thanks a lot for your help with this!
Lina
Comment