Hi there, hoping to get some assistance with showing 4 categories along an x-axis of a bar chart (count) when there are only observations for 3 of those categories in the data set. That is, show that the 4th category recorded no observations. At the moment, my code (see below) is such that only the 3 categories (solar=1, 2 or 3) are displaying and not the 4th (solar=0). I've tried using the "nofill" and "allcategories" commands with no luck. Any help is much appreciated! Cheers!
gen solar = 0 if solar_string=="No Investment"
replace solar = 1 if solar_string=="10kW"
replace solar = 2 if solar_string=="20kW"
replace solar = 3 if solar_string=="30kW"
graph bar (count) solar, over(solar_string, sort(solar)) nofill
Related Posts with Bar Graph: Show Category on x-axis with Zero Observations
Problem with xtcointreg and xtpmg for panel dataDear all, In some literature reviews, I see that panel FMOLS/DOLS will be employed to estimate coin…
Insheeting special characters like é or ü ?Dear all, when I -insheet- data from a .txt file, the special characters -é-, -è-, -ü-, -ä- and -ö- …
Summarize by time for panel dataDer Statalist users, I am trying to generate summary statistics(mean, standard deviation and quinti…
Testing for weak instrumentsI have 3 endogenous variables in my model and I have identified 3 (or max 4) instruments. I wanted t…
xtabond2: question about Sargan, Hansen and p-valuesDear all, I am new to the xtabond2 command and I have been struggling with this for a while so I re…
Subscribe to:
Post Comments (Atom)
0 Response to Bar Graph: Show Category on x-axis with Zero Observations
Post a Comment