Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tabulate frequencies for multiple binary variables into one table

    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.
    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 0 0 0 1 0 0 0 0
    14 0 0 0 1 0 0 0 0
    15 0 0 1 1 0 0 0 1
    16 0 0 0 0 0 0 0 0
    17 1 0 0 0 0 0 0 0
    18 0 0 0 0 0 0 0 0
    19 0 0 0 0 0 0 0 0
    20 0 0 0 0 0 0 0 0
    21 0 0 0 0 0 0 0 0
    22 0 0 1 0 0 0 0 0
    23 1 0 1 0 0 1 0 1
    24 0 0 0 0 0 0 0 0
    25 0 0 0 0 0 0 0 0
    26 0 0 1 0 0 0 0 0
    27 0 0 0 0 0 0 1 0
    28 0 0 0 0 0 0 0 0
    29 0 0 0 0 0 1 0 0
    30 0 0 0 0 0 1 0 0
    Attached Files

  • #2
    Using Statalist is just like making wild mushrooms risotto. If I asked you to make my favorite version of risotto, you'd likely need to know what the SPECIFIC ingredients are and the steps you do to make said dish. Otherwise, you'd likely fail in the attempt.
    So far you've given us neither, no ingredients, no recipe. You're asking us for help to make something and you've not given the dataset you're dealing with or any code you've tried.


    So please, show us your example data using dataex as well as the EXACT code you've tried so far.


    EDIT:

    I'm also confused on how the graph is relevant.

    Comment

    Working...
    X