Announcement

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

  • Transforming time series data into Panel data


    Hello, I have a time series dataset, downloaded from UNCTAD.
    Then I pasted the data into Stata datasheet.
    The data is the following

    var1 var2 var3 var4 var5
    year 1980 1981 1982 1983
    x 1.2 2.3 3.4 4.5
    y 2.1 2.2 2.3 2.4
    z 3.1 3.2 3.3 3.4

    where x, y, z are countries and var2-var5 are years.

    I was trying to transform it using the "reshape" function. It did not solve the problem.
    I appreciate your reply and help.

  • #2
    It looks like you didn't get the first row to be variable names, which might have to do with pasting. It's probably better to import data properly using file --> import. To use reshape long, your variable names are going to need a stub in common, for example value1980, value1981 etc. Then you can use reshape long.
    Code:
    reshape long value, i(country) j(year)

    Comment


    • #3

      Thank you Wouter Wakker. It helped me!

      Comment

      Working...
      X