想用stata将wide数据转换成long我打了reshape long sheet36, i(countryname) j(year)
但是stata显示,求大侠释疑
我把原数据放入附件 请各位帮忙看看
no xij variables found
You typed something like reshape wide a b, i(i) j(j).
reshape looked for existing variables named a# and b# but could not find any. Remember this picture:
long wide
+---------------+ +------------------+
| i j a b | | i a1 a2 b1 b2 |
|---------------| <--- reshape ---> |------------------|
| 1 1 1 2 | | 1 1 3 2 4 |
| 1 2 3 4 | | 2 5 7 6 8 |
| 2 1 5 6 | +------------------+
| 2 2 7 8 |
+---------------+
long to wide: reshape wide a b, i(i) j(j) (j existing variable)
wide to long: reshape long a b, i(i) j(j) (j new variable)
原数据
| Country Name | 1960 [YR1960] | 1961 [YR1961] | 1962 [YR1962] | 1963 [YR1963] | 1964 [YR1964] |
| Argentina | 2.685281 | 2.432308 | 2.328961 | 2.285788 | 2.23608 |
| Australia | 2.783396 | 2.493808 | 2.922755 | 2.390362 | 2.424252 |
| Brazil | 5.204268 | 5.102537 | 5.071378 | 5.018287 | 4.916381 |
| China | 4.935495 | 2.053596 | 3.873678 | 5.493641 | 5.327344 |
| France | 2.447048 | 2.543971 | 2.86061 | 3.354723 | 3.186223 |
| Germany | 1.251659 | 1.20737 | 0.970049 | 1.015019 | 0.895597 |
| India | 2.347275 | 2.589566 | 3.0413 | 3.063189 | 3.09739 |
| Indonesia | 3.998054 | 4.01274 | 4.02288 | 4.048851 | 4.074228 |
| Italy | 2.836401 | 1.498807 | 1.506833 | 1.551287 | 1.636027 |