How do I present the top 1st occupation in a horizontal graph for each level of race.
I tried the below and stata reports:
ERROR:
variables occupation and _variables do not uniquely identify the observations
r(459);
dataex
I tried the below and stata reports:
Code:
clear all sysuse nlsw88, clear preserve contract occupation race, percent(pc) graph hbar (asis) pc if pc>30 , over(occupation, sort(1) descending) blabel(bar, format(%3.2f) over(race)) restore
variables occupation and _variables do not uniquely identify the observations
r(459);
dataex
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(race occupation) int _freq double pc 1 1 249 11.086375779162957 2 1 60 2.671415850400712 3 1 8 .3561887800534283 1 2 231 10.284951024042742 2 2 31 1.3802315227070348 3 2 2 .08904719501335707 1 3 548 24.39893143365984 2 3 170 7.569011576135352 3 3 8 .3561887800534283 1 4 90 4.007123775601069 2 4 12 .5342831700801425 1 5 34 1.5138023152270703 2 5 19 .8459483526268923 1 6 125 5.565449688334818 2 6 118 5.253784505788068 3 6 3 .13357079252003562 1 7 12 .5342831700801425 2 7 16 .7123775601068566 1 8 177 7.880676758682101 2 8 104 4.630454140694568 end label values race racelbl label def racelbl 1 "White", modify label def racelbl 2 "Black", modify label def racelbl 3 "Other", modify label values occupation occlbl label def occlbl 1 "Professional/Technical", modify label def occlbl 2 "Managers/Admin", modify label def occlbl 3 "Sales", modify label def occlbl 4 "Clerical/Unskilled", modify label def occlbl 5 "Craftsmen", modify label def occlbl 6 "Operatives", modify label def occlbl 7 "Transport", modify label def occlbl 8 "Laborers", modify
Comment