Announcement

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

  • Can a variable with letters in it be classified as a numeric variable?

    Hi everyone - new to stata. I have a list of companies in a panel data set that have company ID's. However, within the company ID's they have letters in them too. When I try to tell stata that it is a panel set using xtset it says that I cannot use a string variable for this. My question is can I turn this company ID into a numeric variable and use this to tell stata that I am using panel data?

  • #2
    Yes. You can encode it or fire up egen's group() with label option.

    https://www.stata.com/support/faqs/d...p-identifiers/ doesn't cover all that territory, but it includes solutions.

    Comment

    Working...
    X