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
Removing duplicate permutationsHi, I am trying to remove "duplicate permutations". For instance: ID source target 1 A B 2 A C 3 B…
Panel data with messy time, very large NDear users, My data consists of N=1033 and T=1-15, with a total number of observation of 2300. Time…
How to move State ApplicationI have Stata 13 MP on my current laptop (Macbook Air)). I have just bought a new laptop (MacBook Air…
Avoiding merge m:m problem...Dear Statalisters: I have the following file #1: clear input byte(firmid ownerid) float own byte l…
How to set width Stata MP 16.1 for UnixHello, I am using Stata 16.1 (64-bit, total usable memory 1510.3 GB), and trying to change an extre…
Subscribe to:
Post Comments (Atom)
0 Response to Bar Graph: Show Category on x-axis with Zero Observations
Post a Comment