Announcement

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

  • Keeping value labels after -collapse-

    Hello,

    This may seem like a simple question, but I cannot find an answer anywhere. My value labels disappear after the -collapse- command.

    I have seen many answers on how to keep variable labels (see https://www.stata.com/statalist/arch.../msg00185.html), is there something similar that can be done for value labels?

    Thank you in advance.

  • #2
    I am not sure if there is an option for that given 9 out of 10 times the collapse commands likely change the nature of the variable. However, you can reuse the labeling scheme. If you know the labeling scheme, you can just apply that with -label values var_name label_name-. If not, you can find that out by -describe the_orginal_variable-, the attach labeling scheme can be found there.

    Comment


    • #3
      That makes sense, I am only using -collapse (first) var1 var2 etc.- option, which explains why the value labels could be preserved. Perhaps -collapse- is not the right command to use here.

      Thanks a lot for your help.

      Comment

      Working...
      X