Announcement

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

  • All demographical variables are string

    Hello everybody,

    I have conducted a survey in Qualtrics. Now I have opened my results in Stata, but all my demographical variables (gender, age groups, income groups) are string variables. I have never worked with Stata before.
    My question is: how can I transform my variables so that I can use them in a regression (because string variables I cannot use)

  • #2
    use -destring-,
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str2 age
    "25"
    "26"
    "27"
    "28"
    "29"
    end
    
    destring age, gen(numage)
    for more information, type help destring

    Comment


    • #3
      I'm sympathetic to you as a new user of Stata - there is quite a lot to absorb. And even worse if perhaps you are under pressure to produce some output quickly. Nevertheless, I'd like to encourage you to take a step back from your immediate tasks.

      When I began using Stata in a serious way, I started, as have others here, by reading my way through the Getting Started with Stata manual relevant to my setup. Chapter 18 then gives suggested further reading, much of which is in the Stata User's Guide, and I worked my way through much of that reading as well. All of these manuals are included as PDFs in the Stata installation and are accessible from within Stata - for example, through the PDF Documentation section of Stata's Help menu.

      The objective in doing the reading was not so much to master Stata - I'm still far from that goal - as to be sure I'd become familiar with a wide variety of important basic techniques, so that when the time came that I needed them, I might recall their existence, if not the full syntax, and know how to find out more about them in the help files and PDF manuals.

      Stata supplies exceptionally good documentation that amply repays the time spent studying it - there's just a lot of it. The path I followed surfaces the things you need to know to get started in a hurry and to work effectively.

      Stata also supples YouTube videos, if that's your thing.

      Comment

      Working...
      X