Hi,
I am trying to make a number of graphs using -catplot- and I am wondering if there is any way to show the sample size automatically?
For example, the following code produces the following plot

What I need is something like the plot below, which I've edited manually.

I need to create several hundred plots, so doing this manually is something I would really like to avoid if possible.
Thanks in advance,
Dominic.
I am trying to make a number of graphs using -catplot- and I am wondering if there is any way to show the sample size automatically?
For example, the following code produces the following plot
Code:
sysuse auto.dta, clear set scheme burd5 gen PriceLow = 1 if price <= 5006.5 replace PriceLow = 0 if PriceLow != 1 label define PriceLow 0 "High price" 1 "Low price" label values PriceLow PriceLow catplot rep78, asyvars stack percent(foreign PriceLow) over(PriceLow) /// over(foreign) blabel(bar, pos(center) format(%2.0f)) legend(pos(bottom) col(5))
What I need is something like the plot below, which I've edited manually.
I need to create several hundred plots, so doing this manually is something I would really like to avoid if possible.
Thanks in advance,
Dominic.
Comment