I would like to be able to display each of the 7 categorical variables in a bar graph, even if they have a frequency count of 0.
My current code performs the correct output for my data, but excludes the variables with a count of 0.
The example of my data below contains the combined 11 graphs that are relevant for this data-set (`d' = 11).
1) Is there a simple method to display variables in a bar graph that have a frequency count of 0?
or
2) Is there a method when combing multiple graphs, as completed below, to use a common scale for the categorical axis as can be done with the yaxis (i.e. ycommon)?
I have tried adding the allcategories group_options but cannot arrive at the correct output.
Any solutions to the above?
Liam
My current code performs the correct output for my data, but excludes the variables with a count of 0.
The example of my data below contains the combined 11 graphs that are relevant for this data-set (`d' = 11).
1) Is there a simple method to display variables in a bar graph that have a frequency count of 0?
or
2) Is there a method when combing multiple graphs, as completed below, to use a common scale for the categorical axis as can be done with the yaxis (i.e. ycommon)?
Code:
forvalues i=1(1)`d'{ local j=`i'+1 summ index`j', meanonly local z= r(sum) graph bar, over(s_`i'_SIC_) title("Index `i'") subtitle((n=`z'){superscript:{&alpha}}) ytitle("Percentage (%)") graph save SIC_`i'_percent, replace local SIC_percent`"`SIC_percent' "SIC_`i'_percent""' } gr combine `SIC_percent', title("title") ycommon gr save freq_combined_percent, replace
I have tried adding the allcategories group_options but cannot arrive at the correct output.
Any solutions to the above?
Liam
Comment