Hello all, I understand how useful tabplot can be when plotting graphs. So, I was wondering if it is possible to use it to plot several binary bar graphs where only the yes responses will be plotted horizontally and disaggregated by state, area and gender as contained in the data below. I provided four binary variables, that is, mh2_1_mult mh2_2_mult mh2_3_mult and mh2_4_mult. I used statplot to get the graph below but I need it to be more informative in terms of being able to show n(%) and be able to disaggregate by state, area and gender.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(state sex) float(mh2_1_mult mh2_2_mult mh2_3_mult mh2_4_mult) byte(area _freq) 1 1 0 0 0 0 1 8 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 0 1 9 1 1 1 0 1 1 1 3 1 1 1 1 0 0 1 5 1 1 1 1 0 1 1 3 1 1 1 1 1 0 1 7 1 1 1 1 1 1 1 35 1 2 0 0 0 0 1 2 1 2 0 0 1 1 1 2 1 2 0 1 0 0 1 2 1 2 1 0 0 0 1 5 1 2 1 0 1 0 1 1 1 2 1 0 1 1 1 2 1 2 1 1 0 0 1 22 1 2 1 1 0 1 1 3 1 2 1 1 1 0 1 8 1 2 1 1 1 1 1 35 1 1 0 0 0 0 2 22 1 1 0 0 0 1 2 2 1 1 0 1 1 0 2 1 1 1 1 0 0 0 2 33 1 1 1 0 0 1 2 9 1 1 1 0 1 0 2 1 1 1 1 1 0 0 2 3 1 2 0 0 0 0 2 3 1 2 0 0 1 0 2 4 1 2 0 1 0 0 2 2 1 2 0 1 0 1 2 2 1 2 0 1 1 0 2 4 1 2 0 1 1 1 2 1 1 2 1 0 0 0 2 17 1 2 1 0 1 0 2 4 1 2 1 1 0 0 2 35 1 2 1 1 0 1 2 3 1 2 1 1 1 0 2 4 2 1 0 0 0 0 1 21 2 1 0 0 0 1 1 5 2 1 0 0 1 0 1 5 2 1 0 0 1 1 1 1 2 1 0 1 0 0 1 6 2 1 0 1 0 1 1 1 2 1 0 1 1 0 1 1 2 1 0 1 1 1 1 1 2 1 1 0 0 0 1 9 2 1 1 0 0 1 1 2 2 1 1 0 1 0 1 6 2 1 1 1 0 0 1 17 2 1 1 1 0 1 1 1 2 1 1 1 1 0 1 15 2 1 1 1 1 1 1 3 2 2 0 0 0 0 1 1 2 2 0 0 0 1 1 1 2 2 0 0 1 0 1 3 2 2 0 1 0 0 1 13 2 2 0 1 0 1 1 2 2 2 0 1 1 0 1 7 2 2 1 0 0 0 1 5 2 2 1 0 0 1 1 3 2 2 1 0 1 0 1 9 2 2 1 0 1 1 1 1 2 2 1 1 0 0 1 29 2 2 1 1 0 1 1 3 2 2 1 1 1 0 1 15 2 2 1 1 1 1 1 4 2 1 0 0 0 0 2 28 2 1 0 0 0 1 2 2 2 1 0 0 1 0 2 4 2 1 0 0 1 1 2 2 2 1 0 1 0 0 2 11 2 1 0 1 0 1 2 2 2 1 0 1 1 0 2 4 2 1 1 0 0 0 2 14 2 1 1 0 0 1 2 3 2 1 1 0 1 0 2 9 2 1 1 0 1 1 2 2 2 1 1 1 0 0 2 13 2 1 1 1 0 1 2 1 2 1 1 1 1 0 2 14 2 1 1 1 1 1 2 4 2 2 0 0 0 0 2 6 2 2 0 0 0 1 2 2 2 2 0 0 1 0 2 1 2 2 0 1 0 0 2 1 2 2 0 1 1 1 2 1 2 2 1 0 0 0 2 17 2 2 1 0 0 1 2 8 2 2 1 0 1 0 2 10 2 2 1 0 1 1 2 2 2 2 1 1 0 0 2 19 2 2 1 1 0 1 2 6 2 2 1 1 1 0 2 28 2 2 1 1 1 1 2 5 3 1 0 0 0 0 1 26 3 1 0 0 1 0 1 4 3 1 0 0 1 1 1 2 3 1 0 1 0 0 1 7 3 1 0 1 0 1 1 1 3 1 0 1 1 0 1 4 end label values state state label def state 1 "State1", modify label def state 2 "State2", modify label def state 3 "State3", modify label values sex sex label def sex 1 "Male", modify label def sex 2 "Female", modify label values mh2_1_mult yesno label values mh2_2_mult yesno label values mh2_3_mult yesno label values mh2_4_mult yesno label def yesno 0 "No", modify label def yesno 1 "Yes", modify label values area area label def area 1 "Rural", modify label def area 2 "Urban", modify
Code:
statplot mh2_1_mult mh2_2_mult mh2_3_mult mh2_4_mult, ytitle(Materials used to take care of MH) name(G2, replace)
Comment