Hi,

I'm having an issue with using catplot (SSC) in Stata 12.1. I want to leave some bars out, but want to keep the percentages.

Here is an example:

Code:
sysuse auto, clear

catplot rep78 foreign, percent (foreign) recast(bar)
This generates the following graph:

Array

Now what I want to do, is to only display bar number 4 and 5, while keeping their current percentage of foreign.

I tried the following:
Code:
catplot rep78 foreign if rep78>3, percent (foreign) recast(bar)
If I use this to only select 4 and 5 then it recalculates the percentages in the displayed group. In other words bar 4 in domestic is no longer 19%, but is now displayed as 82%. I would just like to only display 4 and 5 to show how many percent of Domestic have 4 and how many percent have 5 of the entire Domestic 'population', but cannot find a right way.


Is there a way to code catplot to only display rep78 bar 4 and 5, while displaying their percentage of the entire 'population'?