Announcement

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

  • rename a variable with its label

    Hello everyone.

    Please I need to rename a variable with its label.

    Example:

    label variable acute_id2_r1___7 "Secondary reason for each Hospitalization/Emergency admission (choice=Cerebral fat embolism)"

    I need the variable to be named Cerebral_fat_embolism

  • #2
    Code:
    rename acute_id2_r1___7 Cerebral_fat_embolism
    I assume you are looking for a more systematic approach. If so, you need to give us more than one example and/or explain the exact rules for finding the new names within the (lengthy) variable label.

    Personally, I do not think Cerebral_fat_embolism makes for a good variable name; why do you want that in the first place?

    Comment


    • #3
      Hello Daniel, thank you for your response.

      The data is extracted from the Redcap system and generates variables with very long names just like the labels. When you go to create a table it doesn't look enjoyable. Furthermore, it is complicated to analyze because acute_id2_r1___7, acute_id2_r1___8, and acute_id2_r1___9 is a compcomplexe to associate with a diagnosis.



      Thank you

      Comment

      Working...
      X