Hi Statalist
I am using Stata/SE 17.0. I want to make a graph using the user-written demand catplot.
Let's say I have a variable called sample_groups that splits my sample into three groups and then I have a categorical variable that we can call category_var numbered from 1 to 5 (it is numbered numerically but each number shows a different category, e.g. 1 = like it very much, 2 = like it a bit, 3 = neutral,, etc)
you can use this to generate some data
clear
set obs 120
egen sample_groups = seq(), from(1) to(3)
generate category_var = runiformint(1,5)
I want to create a graph that looks something like this:
Meaning, the count in each category over the sub-samples shown in different colours
I tried:
catplot category_var , over(sample)
but that just makes three graphs (almost the same as using the by option)

Any advice would be super helpful!
I am using Stata/SE 17.0. I want to make a graph using the user-written demand catplot.
Let's say I have a variable called sample_groups that splits my sample into three groups and then I have a categorical variable that we can call category_var numbered from 1 to 5 (it is numbered numerically but each number shows a different category, e.g. 1 = like it very much, 2 = like it a bit, 3 = neutral,, etc)
you can use this to generate some data
clear
set obs 120
egen sample_groups = seq(), from(1) to(3)
generate category_var = runiformint(1,5)
I want to create a graph that looks something like this:
Meaning, the count in each category over the sub-samples shown in different colours
I tried:
catplot category_var , over(sample)
but that just makes three graphs (almost the same as using the by option)
Any advice would be super helpful!
Comment