Dear All, I have this data set.
Code:
clear
input int A str12 B str9(C D) str18 E str9 F str15 G str9(H I J K) str11 L str9 M str17 N str9(O P)
   . "Keelung City" ""          ""          ""                   ""          "New Taipei City" ""          ""          ""          ""          "Taipei City" ""          ""                  ""          ""         
   . "variable1"    "variable2" "variable3" "variable4"          "variable5" "variable1"       "variable2" "variable3" "variable4" "variable5" "variable1"   "variable2" "variable3"         "variable4" "variable5"
1991 "439"          "53.25"     "-332.5"    "-718.25"            "-1104"     "704"             "49.31"     "-605.38"   "-1260.07"  "-1914.76"  "28"          "47.11"     "66.22"             "85.33"     "104.44"   
1992 "509"          "53.81"     "-401.38"   "-856.57" "-1311.76"  "789"             "48.29"     "-692.42"   "-1433.13"  "-2173.84"  "26"          "49.5"      "73"                "96.5"      "120"      
1993 "469"          "54.5"      "-360"      "-774.5"             "-1189"     "899"             "47.79"     "-803.42"   "-1654.63"  "-2505.84"  "25"          "45.28"     "65.56"             "85.84"     "106.12"   
1994 "445"          "55.47"     "-334.06"   "-723.59"            "-1113.12"  "914"             "47.85"     "-818.3"    "-1684.45"  "-2550.6"   "27"          "48.41"     "69.81" "91.23"     "112.64"   
end
I'd like to stack the data into
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input str15 id int(year variable1) double(variable2 variable3 variable4 variable5)
"Keelung City"    1991 439 53.25  -332.5  -718.25    -1104
"Keelung City"    1992 509 53.81 -401.38  -856.57 -1311.76
"Keelung City"    1993 469  54.5    -360   -774.5    -1189
"Keelung City"    1994 445 55.47 -334.06  -723.59 -1113.12
"New Taipei City" 1991 704 49.31 -605.38 -1260.07 -1914.76
"New Taipei City" 1992 789 48.29 -692.42 -1433.13 -2173.84
"New Taipei City" 1993 899 47.79 -803.42 -1654.63 -2505.84
"New Taipei City" 1994 914 47.85  -818.3 -1684.45  -2550.6
"Taipei City"     1991  28 47.11   66.22    85.33   104.44
"Taipei City"     1992  26  49.5      73     96.5      120
"Taipei City"     1993  25 45.28   65.56    85.84   106.12
"Taipei City"     1994  27 48.41   69.81    91.23   112.64
end
Any suggestions? Thanks.