Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73200

coefplot - country label on xaxis instead of numbers

$
0
0
Dear Statalist users,

I am trying to produce this graph showing changes in a variable across countries from 1995 to 2010. This is the code I am using with Stata 18. Does anyone have any advice on how to get the ccode (NOR, USA, GBR etc.) labels instead of the numbers on the xaxis?

Code:
mean SK_RR_S100 if y==2010, over(ccode)
matrix b88 = e(b)
mean  SK_RR_S100 if y==1995, over(ccode)
mata: assert(st_matrixcolstripe("b88")==st_matrixcolstripe("e(b)"))
quietly estadd matrix b88
coefplot, ci((b b) (b b88)) ciopts(recast(rcap pcarrow)) cionly ///
   vertical sort(, by(ul 2)) rename(^.+@([0-9]+)\..+$ = \1, regex) ///
   xtitle("test") ytitle("Change in sk_rep from 1995 to 2010")
and I get this graph:
Array

Viewing all articles
Browse latest Browse all 73200

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>