I’m not a data scientist so my jargon is going to be really off here but let me try to break this down. I’m using stata to encode qualitative data for research. I have 5 categorical variables whodunit_1, whodunit_4, whodunit_3, whodunit_4, whodunit_5 that are all encoded and are scaled with the same 4 ordinal scale (0, 1,2,3 and missing). I want to stack them as a percent make up of their respective totals (similar to how pie charts are but for a stack floatplot) but can’t get all the variables on the same print out. This is my initial code which works fine for one catvar but how can I add all of them onto the same graph? my code right now is
- graph bar (percent), over(whodunit_1) stack asyvars
to add an additional categorical variables to this code i tried:
2. graph bar (percent), over(whodunit_1) over(whodunit_2) stack asyvars but this just added them on top of one another rather than separating them as catvar1 and carvar2 in stata. So I was wondering if anyone here knew how to get them in seperated bars. Each bar should represent one distinct categorical variable. I can’t share a lot of information as the data is sensitive. -- I also thought that a floatplot would be helpful and I installed it using "SSC install floatplot" and ran the code floatplot whodunit_1, center(3) fcolors(red*0.6 red*0.2 blue*0.2 blue*0.6 blue) lcolors(red red blue blue blue) but wanted to make it look similar to how Nick Cox has written about it in the past, I want it to look something like
this Thanks in advance!
0 Response to Trouble with stata outputs: graphing multiple catvars in a stacked bar format in stata, help with using Floatplot
Post a Comment