Announcement

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

  • Renaming Dataset Columns

    Hello,

    I'm trying to change alphabet on the columns into their respective years

    I've tried rename C, 1980 but gave me this error: rename oldname newname [, renumber[(#)] addnumber[(#)] sort ...], which I don't know what to make of.

    Thank you for your help


  • #2
    There are a couple of problems:

    The name of a variable (column) cannot be just a number, how would Stata distinguish between 1980 the variable and 1980 the number? It can be _1980 or y1980 or v1980.

    The syntax is rename oldname newname, options Notice that there is no comma between oldname and newname.

    So what you want is probably: rename C y1980
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Maarten Buis That's exactly what I wanted. Thank you very much

      Comment

      Working...
      X