Dear All
I ma trying to make a graph with mean and CF of 3 vars by country and product.
I have generated the following code
I would like to get a graph similar to this one (though i prefer to group by country and then for each country display the two products.
Could you please help me to produce the right graph?
thanks
Federica
I ma trying to make a graph with mean and CF of 3 vars by country and product.
I have generated the following code
Code:
foreach v in mean ub lb { gen `v'1 = . gen `v'2 = . gen `v'3 = . gen `v'4 = . } forval j = 1/3 { ci mean mSPS_`j' if product== 1 & coun==2 quietly { replace mean1 = r(mean) in `j' replace ub1 = r(ub) in `j' replace lb1 = r(lb) in `j' } ci mean mSPS_`j' if product== 2 & coun==2 quietly { replace mean2 = r(mean) in `j' replace ub2 = r(ub) in `j' replace lb2 = r(lb) in `j' } ci mean mSPS_`j' if product== 1 & coun==3 quietly { replace mean3 = r(mean) in `j' replace ub3 = r(ub) in `j' replace lb3 = r(lb) in `j' } ci mean mSPS_`j' if product== 2 & coun==3 quietly { replace mean4 = r(mean) in `j' replace ub4 = r(ub) in `j' replace lb4 = r(lb) in `j' } local call `call' `j' "mSPS_`j'" } twoway scatter mean1 prod, mc(blue) ms(O) || rcap lb1 ub1 prod, lc(blue) /// || scatter mean2 prod, mc(red) ms(Th) || rcap lb2 ub2 prod, lc(red) /// || scatter mean3 prod, mc(red) ms(Th) || rcap lb3 ub3 prod, lc(red) /// || scatter mean3 prod, mc(red) ms(Th) || rcap lb4 ub4 prod, lc(red) /// xla(`call', tlc(none)) ytitle(means and 95% confidence intervals) by(country)
Could you please help me to produce the right graph?
thanks
Federica
Comment