My data structure: One binary and one categorical variable, where var1 (0,1) and var2 (1, 2, 3, 4).
I want to make something like the following bar chart, which has been made with -catplot-
command: catplot var1, over(var2) percent(var1) asyvar recast(bar)
Array
I would like to introduce now the 90% confidence intervals over the different bars (percentages of categories of var2 within the two groups of var1). I was able to find out the 90% confidence intervals for each category of var2 within the categories of var1 with –proportion-
command: proportion var2, over(var1) level(90)
Over | Proportion | Std. Error | 90% CI lower | 90% CI upper |
_prop_1 | ||||
var1.1 | 0.46666017 | 0.0110185 | 0.4485274 | 0.484764 |
var1.2 | 0.5220399 | 0.0070236 | 0.5104759 | 0.53335803 |
... | ... | ... | ... | ... |
Can someone help me to introduce these 90% confidence intervals in this graphic? Or is it not possible to this with the catplot command – is there another possibility to do so?
Your help is very much appreciated - thanks in advance!
0 Response to Problems Introducing CI in Bar Chart
Post a Comment