Announcement

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

  • stata saving string variable as int

    Hi all, I've imported .dat data from IPUMS and used the provided .do file from their website to do so.

    All of the variables are showing up as string variables visually but saved as integers. For example, varname hispan shows items as follows:

    hispan (varname)
    Not Hispanic
    Not Hispanic
    Not Hispanic
    Not Hispanic
    Mexican
    South American

    The variable, however, is saved as int so when I try to destring or encode I get an error stating the variable is already in numeric format.

    Has anyone encountered this and found a decent solution?

    Thank you,

  • #2
    I don't understand your problem - it sounds as though the variable has labels and that is what you are seeing; use -describe- to find out what is going on and, once you see the name of the label, use -label list- to see exactly how the values are labelled; see
    Code:
    h describe
    h label
    that is, when Stata tells you it is already numeric, Stata is correct

    Comment


    • #3
      Thank you! You were right. I was viewing the variable labels and not the values. I had to fix a setting in stata. Thank you for your help.

      Comment

      Working...
      X