I always appreciate for your help. I am struggling with the confidence interval bar in the graph.
I can successfully made a graph with the help of statalist yesterday, but the thing is that I need to display confidence interval in the graph.
The graph I made is below with the following code.Array
Code:
reg CasCov_a dNative if TipoComRev<=2 reg CasCov_b dNative if TipoComRev<=2 gen id=_n reshape long CasCov_, i(id) j(which) string replace which= "CasCov_a" if which=="a" replace which= "CasCov_b" if which=="b" lab def com 0 "Campensino" 1 "Indigineous" lab val dNative com graph bar CasCov_ if TipoComRev<=2, over(dNative) /// over(which, relabel(1 "Case(all)" 2 "Case(confirmed)")) bgcolor(white) plotregion(fcolor(white)) /// graphregion(fcolor(white)) asyvars showyvars leg(off) ytitle("")
What I need to show is as follows with the CI bar after the regression. If you can see, there is line for 95% CI.
Array
I have been looking forward the command to show it, but coefplot (ssc) seems fine but I cannot find anything to show multiple variables by group in one chart.
Could you let me know the way to draw the graph I showed?
I attach the data below.
Thank you so much for your help in advance.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double UBIGEO float(CasCov_a CasCov_b dNative TipoComRev) 1601070080 1 0 1 2 1601070007 1 0 1 2 1601070072 1 0 0 1 1601100021 0 0 1 2 1605040002 1 0 0 1 1601070010 1 0 1 2 1605050012 1 0 0 1 1601070057 1 0 0 1 1601070074 1 1 1 2 1601060014 1 0 0 1 1607060009 1 0 1 2 2501010062 1 0 0 1 1601070073 1 0 0 1 1601050053 1 0 0 1 1601070090 1 1 1 2 1601070061 1 0 1 2 2501050091 1 0 0 1 1601070048 1 0 1 2 1601070015 1 0 1 2 1601060061 1 0 0 3 1601070071 1 0 1 2 1601070079 1 0 1 2 1601060013 1 0 0 1 1601070030 1 0 1 2 1601060046 1 0 0 1 1601070086 1 0 1 2 1601070024 1 0 1 2 1601070076 1 0 1 2 2501030036 1 0 1 2 1605060013 1 0 1 2 1601070054 1 0 1 2 1607060064 1 0 1 2 1601070014 1 0 1 2 1601070044 1 0 1 2 1601100016 0 0 1 2 1601070006 1 0 1 2 1601070033 1 0 1 2 2501040034 1 1 1 2 2501010197 0 0 0 1 1606020002 0 0 0 1 1601100013 0 0 1 2 2501050062 1 0 1 2 1601070004 1 0 1 2 2501050030 1 0 0 1 1607060051 1 0 1 2 2502030005 1 1 1 2 2501010200 1 0 0 1 1601060024 1 0 0 1 1605060014 1 0 1 2 1601040017 1 0 0 1 1601070005 1 0 1 2 1601060028 1 0 0 1 2501040037 1 0 1 2 1601060017 1 0 0 1 2501030020 1 0 1 2 2502030015 1 1 0 1 1606050021 1 0 0 1 2501040036 1 0 0 1 1601070187 1 0 1 2 2501040094 1 0 0 1 2501070025 1 1 1 2 2501050021 1 1 1 2 1601060015 1 0 0 1 1605060020 1 0 1 2 1601080031 1 0 0 1 2501040032 1 1 1 2 1601060033 1 0 1 2 2501050011 1 0 0 1 1606020005 1 0 0 1 1601060004 1 0 1 2 2501010084 0 0 1 2 1601100010 0 0 1 2 2501070010 1 0 0 1 1601070053 1 0 1 2 1601060012 1 0 1 2 2501040028 1 0 0 1 1606050029 1 1 0 1 1601060045 0 0 0 1 2502030073 1 1 1 2 2501040018 1 1 0 1 2501010094 1 1 1 2 1601060052 1 0 0 1 1601060020 1 0 0 1 1601070088 1 0 0 1 1601050052 1 0 0 1 1601060060 1 0 0 1 1601070002 1 0 1 2 2501040057 0 0 0 1 2501040051 1 0 0 1 1601070067 1 0 0 1 1605060018 1 0 1 2 1601070083 1 0 1 2 2501040015 1 . 0 1 2501030009 1 1 1 2 1601060026 1 0 0 1 2501040025 1 1 1 2 1601080036 1 0 0 1 1601070034 1 0 1 2 2501040048 0 0 0 1 1601080060 1 0 1 2 end label values CasCov_a CasCov_a_label label def CasCov_a_label 0 "No", modify label def CasCov_a_label 1 "Si", modify label values CasCov_b CasCov_b_label label def CasCov_b_label 0 "No", modify label def CasCov_b_label 1 "Si", modify label values TipoComRev L_TipoCom label def L_TipoCom 1 "Campesino", modify label def L_TipoCom 2 "Nativa", modify label def L_TipoCom 3 "Colono", modify
0 Response to Multiple Bars with 95% CI bar
Post a Comment