Announcement

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

  • Numbers instead of variable names

    I downloaded a .dta file. All of the variable names are numbers. Is there anything I can do to fix this? Thank you.

  • #2
    Well, that seems odd, since Stata variable names must begin with a letter or underscore. So I'm probably not understanding what you are describing, nor the question you want addressed. And since you haven't told us where we can see the .dta file ourselves, there's not much progress to be made.

    Take a few moments to review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. Note especially sections 9-12 on how to best pose your question. It's particularly helpful to copy commands and output from your Stata Results window and paste them into your Statalist post using code delimiters [CODE] and [/CODE], and to use the dataex command to provide sample data, as described in section 12 of the FAQ.

    The more you help others understand your problem, the more likely others are to be able to help you solve your problem.

    Comment


    • #3
      Hi William, I am sorry I forgot to include that data. I have attached the file. I know it is very strange I have never had this happen before.

      Comment


      • #4
        For some reason it will not upload. I have attached a screen shot of the variable list.

        Attached Files

        Comment


        • #5
          William gave excellent advice in #2. But there is no information in '#3 and the Word attachment in #4 is explicitly advised against in the FAQ with explanations why. For a start, many members here can't even open Word documents.

          In addition, just copying and pasting the results of describe would allow us to think about your claim. Here's the kind of output that would help.

          Code:
          . describe
          
          Contains data from C:\Program Files\Stata15\ado\base/a/auto.dta
            obs:            74                          1978 Automobile Data
           vars:            12                          13 Apr 2016 17:45
           size:         3,182                          (_dta has notes)
          --------------------------------------------------------------------------------------
                        storage   display    value
          variable name   type    format     label      variable label
          --------------------------------------------------------------------------------------
          make            str18   %-18s                 Make and Model
          price           int     %8.0gc                Price
          mpg             int     %8.0g                 Mileage (mpg)
          rep78           int     %8.0g                 Repair Record 1978
          headroom        float   %6.1f                 Headroom (in.)
          trunk           int     %8.0g                 Trunk space (cu. ft.)
          weight          int     %8.0gc                Weight (lbs.)
          length          int     %8.0g                 Length (in.)
          turn            int     %8.0g                 Turn Circle (ft.)
          displacement    int     %8.0g                 Displacement (cu. in.)
          gear_ratio      float   %6.2f                 Gear Ratio
          foreign         byte    %8.0g      origin     Car type
          --------------------------------------------------------------------------------------
          Sorted by: foreign

          Comment


          • #6
            The Results window in the posted screenshot (opened by a a non-MS app that opens Word documents) is largely the results of the command -tab ptdtrace- and clearly that variable name is not numbers, but the values are all numbers, although I do not understand why you would find that surprising, unless perhaps you were very unfamiliar with data.

            The Variables window shows that all your variable names are as expected,

            The Review window at the left shows that your second command began a log of you results with a name beginning Homework1Final... . Item #4 in https://www.statalist.org/forums/help#adviceextras explains why in general Statlist prefers not to give help with homework.

            Comment


            • #7
              Yes, it is homework I am in grad school. My professor has been out sick so I didn't think she would write back. Turns out she didn't remember the variable names so she didn'tt include them in the file. I thought I was going crazy. I need to run a .do file to get them.

              Comment


              • #8
                Sorry, but the Stata part of #7 makes no sense. You have variable names in your dataset. Not only can Stata not work without them, William reports that he can see them in your screenshot, and I do believe him.

                Perhaps the dataset is incomplete in some other sense, e.g. a lack of value labels, but that would be a different issue.

                Comment


                • #9
                  Ryan Matthews - Have you perhaps confused "value labels" with "variable names"? Both phrases have particular technical meanings in Stata, and I would have expressed this in post #6 but for the fact that it was written on a tablet in less-than-ideal circumstances for researching further and expressing complexity.

                  In the screenshot you provided the tabulated variable ptdtrace has a "variable label" (another technical term) of "RACE" and takes values 1-26 and -1. This is consistent with data taken from the US Current Population Survey in 2012 or later. So I'm assuming the .do file referred to in post #7 used the value label command to define a value label and apply it to ptdtrace.

                  As an international forum, for many members English is not their first language, although your mastery of it suggests otherwise. So, if this isn't a simple "lost in translation" problem, I'd like to encourage you to improve your understanding of Stata basics by reading through the Getting Started with Stata for Windows manual. That will help you understand the basic terminology common to all aspects of Stata, which will improve your chances of successfully communicating your questions on Statalist, or perhaps even solving problems like this on your own.

                  If you're going to be making much use of Stata (as opposed it being a one-semester only chore) then Chapter 18 gives suggested further reading, much of which is in the Stata User's Guide. I worked my way through much of that reading when I took up Stata seriously. All of these manuals are included as PDFs in the Stata installation (since version 11) and are accessible from within Stata - for example, through Stata's Help menu. The objective in doing this was not so much to master Stata 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 manual.

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

                  Comment

                  Working...
                  X