Goodmorning,
I have the following dataset were percent1 percent2 perecent3 are the perecentage of individual (divided in 3 different group) that belong to a specific occupation which can range between 1 and 9
I was wondering how could I do a grap bar where the name of the occupation is displayed only once and not, as in my case, for every group in which I divided the population.
Thanks for you attention
I have the following dataset were percent1 percent2 perecent3 are the perecentage of individual (divided in 3 different group) that belong to a specific occupation which can range between 1 and 9
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(percent1 percent2 percent3 occupation_name) .15052333 . . 6 .15052333 . . 6 .07870075 . . 7 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .07999493 . . 8 .07870075 . . 7 .03209662 . . 1 .15052333 . . 6 .15052333 . . 6 .07999493 . . 8 .15052333 . . 6 .15052333 . . 6 .03209662 . . 1 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .03209662 . . 1 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .03209662 . . 1 .15052333 . . 6 .07999493 . . 8 .15052333 . . 6 .07999493 . . 8 .15052333 . . 6 .07870075 . . 7 .03209662 . . 1 .03209662 . . 1 .15052333 . . 6 .12454466 . . 4 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .03209662 . . 1 .15052333 . . 6 .07870075 . . 7 .07999493 . . 8 .18556127 . . 5 .15052333 . . 6 .07999493 . . 8 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .07999493 . . 8 .07999493 . . 8 .03209662 . . 1 .15052333 . . 6 .15052333 . . 6 .07999493 . . 8 .07999493 . . 8 .12454466 . . 4 .15052333 . . 6 .15052333 . . 6 .07999493 . . 8 .15052333 . . 6 .07870075 . . 7 .03209662 . . 1 .07870075 . . 7 .15052333 . . 6 .07999493 . . 8 .15052333 . . 6 .07999493 . . 8 .18539837 . . 3 .07999493 . . 8 .07999493 . . 8 .07999493 . . 8 .15052333 . . 6 .18539837 . . 3 .15052333 . . 6 .15052333 . . 6 .07999493 . . 8 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .07999493 . . 8 .07999493 . . 8 .15052333 . . 6 .15052333 . . 6 .07999493 . . 8 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .03209662 . . 1 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .15052333 . . 6 .03209662 . . 1 .07999493 . . 8 .15052333 . . 6 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .184801 . 6 . .184801 . 6 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .07599492 . 7 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .184801 . 6 . .184801 . 6 . .0296359 . 3 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .07599492 . 7 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .184801 . 6 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .184801 . 6 . .184801 . 6 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .184801 . 6 . .184801 . 6 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . .3693903 . 8 . . .59322035 8 . . .59322035 8 . . .22881356 6 . . .59322035 8 . . .22881356 6 . . .59322035 8 . . .59322035 8 . . .22881356 6 . . .59322035 8 . . .22881356 6 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .22881356 6 . . .59322035 8 . . .22881356 6 . . .59322035 8 . . .22881356 6 . . .05084746 7 . . .59322035 8 . . .05084746 7 . . .05084746 7 . . .22881356 6 . . .22881356 6 . . .016949153 3 . . .59322035 8 . . .22881356 6 . . .05084746 7 . . .22881356 6 . . .22881356 6 . . .22881356 6 . . .59322035 8 . . .22881356 6 . . .05084746 7 . . .22881356 6 . . .22881356 6 . . .22881356 6 . . .05084746 7 . . .59322035 8 . . .22881356 6 . . .22881356 6 . . .59322035 8 . . .22881356 6 . . .22881356 6 . . .22881356 6 . . .59322035 8 . . .22881356 6 . . .22881356 6 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .10169491 5 . . .59322035 8 . . .22881356 6 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .10169491 5 . . .59322035 8 . . .10169491 5 . . .10169491 5 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .10169491 5 . . .59322035 8 . . .10169491 5 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .22881356 6 . . .10169491 5 . . .10169491 5 . . .59322035 8 . . .016949153 3 . . .59322035 8 . . .22881356 6 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 . . .59322035 8 end label values occupation_name za_all label def za_all 1 "senior management", modify label def za_all 3 "technicians", modify label def za_all 4 "technicians", modify label def za_all 5 "Q.P. commercial act. and services", modify label def za_all 6 "craftsmen, farmers, skilled w.", modify label def za_all 7 "machinery workers, veichle drivers", modify label def za_all 8 "unskilled professions", modify
Code:
graph hbar percent1 percent2 percent3, over (occupation_name, sort(1)label(nolabel))graphregion(color(white)) ytitle (Percentage, size(small)) legend (label(1 "Native") label(2 "Other migrants") label(3 "Refugees")) bar(1, fcolor(yellow)) bar(2, fcolor(orange)) bar(3, fcolor(red)) blabel(group, position (outside) orientation(horizontal) size(vsmall))
Comment