Hi
I have a question, How can i draw graph like this? what is the name of this graph and what is the command
?
thank you.
I have a question, How can i draw graph like this? what is the name of this graph and what is the command
?
thank you.
graph dot per, over (bed) asyvars over (city) vertical
city | bed | per |
tehran | icu | 1 |
mashad | icu | 0.9 |
shiraz | icu | 0.8 |
tehran | ccu | 1.2 |
mashad | ccu | 1 |
shiraz | ccu | 0.9 |
tehran | burn | 0.9 |
mashad | burn | 0.8 |
shiraz | burn | 0.7 |
clear input str6 city str4 bed per tehran icu 1 mashad icu 0.9 shiraz icu 0.8 tehran ccu 1.2 mashad ccu 1 shiraz ccu 0.9 tehran burn 0.9 mashad burn 0.8 shiraz burn 0.7 end replace city = proper(city) graph dot (asis) per, over(city) over(bed) linetype(line) lines(lc(gs12) lw(vthin)) ytitle(whatever you want) ysc(alt)
clear input str3 location valueMEN valueTOT valueWOMEN ZAF 55.5 57.5 59.5 RUS 66.5 71.8 77.1 IND 66.9 68.4 69.9 IDN 67 69.1 71.2 LTU 69.5 74.8 80.1 LVA 69.8 74.7 79.6 BRA 71 74.8 78.5 HUN 72.6 76.2 79.7 MEX 72.9 75.4 77.9 COL 73.1 76.2 79.4 EST 73.3 77.8 82.2 SVK 73.8 77.3 80.7 POL 73.9 78 82 CHN 74.5 76 77.5 TUR 75.3 78 80.7 CZE 76.1 79.1 82.1 USA 76.1 78.6 81.1 CHL 77.1 79.9 82.7 CRI 77.2 79.6 82.1 PRT 78.1 81.2 84.3 SVN 78.2 81.3 84.3 DEU 78.6 81.1 83.5 FIN 78.6 81.5 84.4 GRC 78.9 81.5 84 DNK 79 80.9 82.8 BEL 79 81.5 84 FRA 79.2 82.4 85.5 AUT 79.3 81.7 84.1 KOR 79.3 82.4 85.4 GBR 79.4 81.2 83 CAN 79.8 81.9 83.9 IRL 79.9 81.8 83.6 NLD 80 81.6 83.2 NZL 80 81.7 83.4 LUX 80.1 82.8 85.4 ISL 80.4 82.3 84.1 AUS 80.4 82.5 84.6 ESP 80.5 83.4 86.3 SWE 80.6 82.4 84.1 ISR 80.7 82.5 84.2 NOR 80.7 82.5 84.2 JPN 81 84.1 87.1 ITA 81 83.3 85.6 CHE 81.7 83.7 85.6 end sort valueMEN seqvar axis=1/44 labmask axis, values( location ) twoway (dropline valueWOMEN axis, msymbol(X) xla(1/44, valuelabels ang(v) nogrid labsize(2))) /// (dropline valueTOT axis)(dropline valueMEN axis, msymbol(Dh)) /// , legend (position(6) rows(1) size(2)label(1 "Women") label(2 "Total") label(3 "Men")) /// yscale(range(55(5)90)) xsize(4) ysize(2) graphregion(color(white)) /// ytitle("Life Expectancy" (Year), size(3))xtitle("OECD Countries", size(3)) name(G1) set scheme s1color rename (valueMEN valueTOT valueWOMEN ) (men all women) sort men gen which = _n > 22 graph dot (asis) men all women, by(which, title(Life expectancy (years), size(medium)) note("")) over(location, sort(1)) exclude0 linetype(line) lines(lw(vthin) lc(gs12)) /// marker(1, mc(blue) ms(+)) marker(2, mc(black) ms(X)) marker(3, mc(magenta) ms(Oh)) legend(row(1) pos(8)) /// yla(55(5)85) ysc(r(53 .)) nofill subtitle("", pos(9) nobox nobexpand) name(G2)
Comment