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
Mixed model syntax and output questionHello -- I am trying to fit a mixed effect linear model to some data. For context, I have 4 raters …
r(134) too many valuesDear Statalist, I've run my regressions and now I would like to confirm my results on a panel of fi…
Drop duplicate pairs (X,Y; Y,X)Unfortunately, I was not able to find out how to drop a pair of duplicates. Let's say we have variab…
Mixed model syntax and output questionHello -- I am trying to fit a mixed effect linear model to some data. For context, I have 4 raters …
test of multicollinarity in multiple linear regression.Hi guys I have a multiple linear regression looking like this : Y = Var1 (dummy) + Var 2 + Var 3 + …
Subscribe to:
Post Comments (Atom)
0 Response to Bar Graph: Show Category on x-axis with Zero Observations
Post a Comment