Dear all,
There have been a few threads about problems with confidence intervals on graphs – I’m afraid I am in the midst of one.
I am trying to make a dotplot, with the dots indicating regression coefficients; and whiskers above and below, confidence intervals. These data originate from a series of logistic regressions, individually exported into a table of the format:
The graph I would like to plot is therefore something like:
combined with:
But of course the syntax for the second is incorrect because string variables [country] can’t be used with -twoway- graphs.
I feel this should be simple with a scatterplot or dotplot, but cannot find a way to simply specify the values of my dots and whiskers on a graph with a discrete x-axis variable [note - this is only a problem because I'm specifying CI values rather than calculating from a dataset - otherwise, -ciplot- would do this].
I want to generate a graph which looks something like the version below (generated by changing the string values of my countries to numbers) but there is surely a simpler solution than re-labeling the axis?
Thank you very much for any advice – I am using Stata v. 15.
Josh.

There have been a few threads about problems with confidence intervals on graphs – I’m afraid I am in the midst of one.
I am trying to make a dotplot, with the dots indicating regression coefficients; and whiskers above and below, confidence intervals. These data originate from a series of logistic regressions, individually exported into a table of the format:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str9 country float(coef ci_low ci_high) "country_a" .205 .158 .267 "country_a" .081 .055 .12 "country_b" .094 .083 .105 "country_c" .105 .089 .124 "country_c" .056 .036 .086 end
Code:
dotplot coef, over(country)
Code:
twoway (rcap ci_low ci_high), over (country)
I feel this should be simple with a scatterplot or dotplot, but cannot find a way to simply specify the values of my dots and whiskers on a graph with a discrete x-axis variable [note - this is only a problem because I'm specifying CI values rather than calculating from a dataset - otherwise, -ciplot- would do this].
I want to generate a graph which looks something like the version below (generated by changing the string values of my countries to numbers) but there is surely a simpler solution than re-labeling the axis?
Thank you very much for any advice – I am using Stata v. 15.
Josh.
Code:
twoway (rcap ci_low ci_high count) (scatter coef country)
Comment