Announcement

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

  • Data variables are in red

    I need help in this issue as in the attached photos.
    I have the variable names are in red and I don't know why.
    Secondly, the photo of the summary statistics, there's something wrong, I don't have the total obs, and the software is showing the summary in columns of years not as rows of countries.

    Thank you
    Attached Files

  • #2
    Hi Mustapha
    The short answer is: Stata uses color coding.
    WHen you browse or edit , and something is in black, it means is stored as a number. if its in blue then is stored as a number, but labeled, with the label being displayed.
    Finally, if its red it simply means its stored as text. So for your question, if you need the data to be "long" you need to reshape it as such.
    See "help reshape long"
    HTH
    Fernando

    Comment


    • #3
      Red is not necessarily a problem, it just means it is a string (a sequence of letters) rather than a number. As to the output from summarize, variable names cannot be just a number, so the variable name cannot be 2008, or 2009. I suspect you imported data from Excel, so if you give it impossible variable names (just years), Stata uses the column letter instead and adds the impossble name (in your case year) as a label.
      ---------------------------------
      Maarten L. Buis
      University of Konstanz
      Department of history and sociology
      box 40
      78457 Konstanz
      Germany
      http://www.maartenbuis.nl
      ---------------------------------

      Comment


      • #4
        Thank you Mr. Maarten,

        Do I need to replace the columns with rows in order for stata to read the variables as the country names instead of reading the variables as year?

        Comment


        • #5
          Originally posted by Maarten Buis View Post
          Red is not necessarily a problem, it just means it is a string (a sequence of letters) rather than a number. As to the output from summarize, variable names cannot be just a number, so the variable name cannot be 2008, or 2009. I suspect you imported data from Excel, so if you give it impossible variable names (just years), Stata uses the column letter instead and adds the impossble name (in your case year) as a label.



          Thank you Mr. Maarten,

          Do I need to replace the columns with rows in order for stata to read the variables as the country names instead of reading the variables as year?

          Comment

          Working...
          X