Hello everyone,
first post in the forum so apologies if something is misspecified/does not follow all publication guideliens.
I have an issue with the following code
twoway (histogram quality_8 if treatment == 0, discrete frequency width(0.4) start(0) color(blue%50)) ///
(histogram quality_8 if treatment == 1, discrete frequency width(0.4) start(2) color(red%50)), ///
xlabel(1 "Outside covered" 2 "Outside not covered" 3 "Inside covered" 4 "Inside not covered", angle(45)) ///
xtitle("") ///
ytitle("Frequency") ///
legend(order(1 "Control" 2 "Treatment") position(6)) ///
title("Distribution of quality_8 by Treatment Status") ///
ylabel(, angle(horizontal))
it should create a histogram for a categorical variable (quality_8) that has 5 categories (I chose the histogram environment has only one category is present in the data, and using bar graph it does not display on the x axis the categories with missing observations), sorted by treatment.
The issue is that the bars are overlapping, even if I set two different starts.
Any way to keep the same code and have side by side bars?
Many thanks in advance.
first post in the forum so apologies if something is misspecified/does not follow all publication guideliens.
I have an issue with the following code
twoway (histogram quality_8 if treatment == 0, discrete frequency width(0.4) start(0) color(blue%50)) ///
(histogram quality_8 if treatment == 1, discrete frequency width(0.4) start(2) color(red%50)), ///
xlabel(1 "Outside covered" 2 "Outside not covered" 3 "Inside covered" 4 "Inside not covered", angle(45)) ///
xtitle("") ///
ytitle("Frequency") ///
legend(order(1 "Control" 2 "Treatment") position(6)) ///
title("Distribution of quality_8 by Treatment Status") ///
ylabel(, angle(horizontal))
it should create a histogram for a categorical variable (quality_8) that has 5 categories (I chose the histogram environment has only one category is present in the data, and using bar graph it does not display on the x axis the categories with missing observations), sorted by treatment.
The issue is that the bars are overlapping, even if I set two different starts.
Any way to keep the same code and have side by side bars?
Many thanks in advance.
Comment