我用stata的reshape 处理数据,
. reshape long DR NDTS,i(id) j(year)
显示???请大神赐教!!!!!我实在是不懂问题出在哪里了?求!!!!
(note: j = 2013 2014 2015 2016)
variable id does not uniquely identify the observations
Your data are currently wide. You are performing a reshape long. You specified i(id) and j(year). In the current wide form, variable id
should uniquely identify the observations. 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 |
+---------------+
Type reshape error for a list of the problem observations.
r(9);
下面是我用的部分数据
id DR2013 DR2014 DR2015 DR2016 NDTS2013 NDTS2014 NDTS2015 NDTS2016
300001 38.7813 48.2982 58.2114 74.8315 .02830112 .0369674 .02640345 .02464727
300002 13.2699 10.9302 15.6048 28.3951 .08429957 .07762891 .06356485 .05017333
300003 7.4744 14.03 30.9355 36.7048 .05306036 .06167594 .04064887 .04464172
300004 24.6462 20.033 18.66 18.5856 .03214053 .01799778 .0222662 .02166787
300005 29.4846 26.7455 39.7269 20.2314 .06197805 .06607152 .047317 .03062038
300006 48.4125 54.6796 45.5364 32.6013 .0750414 .06359187 .04648831 .05924261
300007 26.7883 31.5393 46.5863 52.5594 .05553819 .0383156 .0327885 .03297481
300008 16.4177 36.1288 44.5479 23.5846 .04217657 .02003453 .01634636 .01029484
300009 11.8979 15.5209 9.764 27.4289 .05627435 .14624056 .05155472 .06991676
300010 28.9958 28.8986 34.9581 28.5154 .05039427 .04787896 .04829302 .03445002
300011 18.4642 14.4754 33.3319 34.4506 .08780522 .03859543 .03726996 .03740858
300012 14.3946 18.5966 22.7119 21.2056 .11496256 .0806883 .09365106 .07825966
300013 33.2112 46.5027 30.4001 32.4208 .02148947 .01891677 .01940693 .03565563
300014 29.4663 39.2788 28.7108 52.2712 .06459997 .0798826 .04742133 .04311542
300015 17.9367 17.7638 23.2578 27.7647 .01464973 .01581899 .01594701 .01498428
300016 9.8561 26.5348 11.1796 5.6896 .03074871 .03106072 .05824466 .0525187
300017 18.1921 17.2776 28.2908 15.0789 .10217971 .13295013 .12870117 .08125106