Hello,
I am looking for a code to combine multiple binary variables into one table and bar graph so that for each response (.e.g, Previous C-section, Multiple Pregnancy, etc.), there is a proportion listed (e.g., X out of 30 individuals surveyed noted a history of a previous C-section).
The data was generated from a survey that gave the option for responders to 'Select all that apply' to the question so for each individual, there may be more than one option selected. I had tried to generate a new variable but was not able to do this and allow for more than one option for each individual.
The raw data generated by REDCap provides each option for the question as a separate variable coded as 'Checked' or 'Unchecked'. I have recoded this as Checked=1 and Unchecked=0.
Any help would be much appreciated! Thank you in advance.
I am looking for a code to combine multiple binary variables into one table and bar graph so that for each response (.e.g, Previous C-section, Multiple Pregnancy, etc.), there is a proportion listed (e.g., X out of 30 individuals surveyed noted a history of a previous C-section).
The data was generated from a survey that gave the option for responders to 'Select all that apply' to the question so for each individual, there may be more than one option selected. I had tried to generate a new variable but was not able to do this and allow for more than one option for each individual.
The raw data generated by REDCap provides each option for the question as a separate variable coded as 'Checked' or 'Unchecked'. I have recoded this as Checked=1 and Unchecked=0.
Any help would be much appreciated! Thank you in advance.
ID | Prev_CS | Multiple | NRFHR | Prolonged_Labour | Chorioamnionitis | Placental_Problem | Malpresentation | Other_CS |
1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 |
3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |
10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
11 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
12 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
13 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