Announcement

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

  • Generate string with decode

    Hi,

    I like to generate a string variable out of a numeric (format: double) variable.
    Unfortunately "decode" does not work as the variables aren't labled yet

    What command do I need to generate the string or should I label the numeric variable first?


    Thanks for your advice!
    Click image for larger version

Name:	Screenshot 2022-04-04 083806.png
Views:	3
Size:	6.5 KB
ID:	1657795


    Attached Files

  • #2
    Why do you need a string variable?

    Code:
    help tostring 

    Comment


    • #3
      Hi! Thanks for your answer
      I want to merge two datatsets and use wharton_bx_id and year as the key variable
      Unfortunately although I have found a lot of matches stata does not match them, so I try to change the format ?

      Comment


      • #4
        merge certainly won't match a numeric identifier in one dataset with a string identifier in another dataset, if that is the problem. So, you do need to change variable or storage type (not format in Stata terms).

        Comment

        Working...
        X