Hi,
I am new to STATA so please excuse my ignorance, this may be a rather simple question. I am using STATA/IC 15.1
I have a dataset where some questions provided multiple tickboxes that the respondent can tick, rather than a question where only one answer can be selected. When I exported the data this has of course generated a variable in STATA for each tickbox, with the values being 0/1 "Unchecked"/"Checked". I converted the 0 "Unchecked" values to missing values (not sure if this was the right thing to do, but I was trying a few things out). It's easy for me to find out how many of each reason were checked, I am just having difficulty converting this to one graph with all the variables, which is what I really need to do.
So the data looks something like this (this particular question was 'Reasons for undergoing [procedure]', with a number of options)
I would like to produce a simple graph like the one that I can produce in Excel from the raw data in a matter of seconds using the =countif function, that looks something like this (N.B. this is not the actual data, I just made up these numbers):

If anyone could assist me or point me in the right direction (I feel like I must be missing something obvious?), I would be very grateful.
I am new to STATA so please excuse my ignorance, this may be a rather simple question. I am using STATA/IC 15.1
I have a dataset where some questions provided multiple tickboxes that the respondent can tick, rather than a question where only one answer can be selected. When I exported the data this has of course generated a variable in STATA for each tickbox, with the values being 0/1 "Unchecked"/"Checked". I converted the 0 "Unchecked" values to missing values (not sure if this was the right thing to do, but I was trying a few things out). It's easy for me to find out how many of each reason were checked, I am just having difficulty converting this to one graph with all the variables, which is what I really need to do.
So the data looks something like this (this particular question was 'Reasons for undergoing [procedure]', with a number of options)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(reasons___1 reasons___2 reasons___3 reasons___4 reasons___5 reasons___6) 1 . 1 . 1 . 1 . 1 . . . 1 . 1 . . . 1 . 1 . . 1 1 . 1 1 . . 1 . 1 1 1 1 1 . 1 . . 1 1 . 1 1 . . 1 . . . . 1 1 . 1 1 . . 1 . . . 1 1 1 . 1 1 . . . . 1 . . . . . . . . 1 1 . 1 . 1 1 1 . 1 1 . . 1 . . . . 1 1 . 1 1 . . 1 . 1 1 . . 1 . 1 1 . . 1 . 1 1 . . 1 . 1 . . . 1 . 1 1 . 1 1 . 1 . 1 . 1 . . . . . 1 . 1 1 1 1 1 . . . . 1 . . . . 1 1 1 . 1 . 1 . 1 . 1 1 . . 1 1 . . 1 . 1 . . . . 1 1 . . 1 . . . . . . . 1 end label values reasons___1 reasons___1_ label def reasons___1_ 1 "Checked", modify label values reasons___2 reasons___2_ label def reasons___2_ 1 "Checked", modify label values reasons___3 reasons___3_ label def reasons___3_ 1 "Checked", modify label values reasons___4 reasons___4_ label def reasons___4_ 1 "Checked", modify label values reasons___5 reasons___5_ label def reasons___5_ 1 "Checked", modify label values reasons___6 reasons___6_ label def reasons___6_ 1 "Checked", modify
If anyone could assist me or point me in the right direction (I feel like I must be missing something obvious?), I would be very grateful.
Comment