Announcement

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

  • Need help with reshaping data

    Hi - I need assistance with reshaping data.

    I have a dataset that looks like this where data from redcap is imported into separate forms and then the variables for each form are listed horizontally. I am struggling with the reshape command because the data is both long and wide at the same time.

    I would like to have a single row per study id number with all the data in wide form.

    This is what the data currently looks like.
    studyID form form_a_var_1 form_a_var_2 form_a_var_3 form_b_var_1 form_b_var_2 form_b_var_3
    1 a x x x
    1 b x x x
    2 a x x x
    2 b x x x
    And this is what I would like it to look like:
    studyID form form_a_var_1 form_a_var_2 form_a_var_3 form_b_var_1 form_b_var_2 form_b_var_3
    1 a x x x x x x
    2 a x x x x x x
    Thanks in advance for your help!

    Ribka
Working...
X