I have a string variable (Reasons_Inadmissible) with multiple values that are comma separated. It lists all of the reasons why a case is inadmissible; multiple reasons can be listed in one cell. For example, one cell will read HRM, another will read HRM, LAW, another will read LAW, etc. Other values include REP, LON, OTE and others. I am trying to produce a frequency bar graph which indicates the number of cases where Reasons_Inadmissible is HRM, the number of cases where Reasons_Inadmissible is LAW, etc. In other words, I want a bar chart to indicate the number of cases that invoked a particular reason. Individual cases can be double-counted in this bar chart. I tried:

catplot Reasons_Inadmissible

But, it produces a bar chart with all possible combinations (i.e. HRM; HRM, LAW; HRM, OTE; LAW; OTE). Instead, I want the bars to represent the number of cases where one of the reasons was listed (just HRM, LAW, REP, OTE-- individually).

One options would be to generate a series of binary variables that are equal to 1 for each Reasons_Inadmissible value. For example:
gen HRC = 1 if strpos(Reasons_Inadmissible,"HRC")

gen LAW = 1 if strpos(Reasons_Inadmissible,"LAW")

However, in that case, how do I generate a bar graph, where the bars are counts of the different binary variables? Alternatively, is there another way you would recommend generating this graph from a comma-separated categorical variable?

Thanks!

Erica