sewind_tj 发表于 2013-4-11 13:22 
也许下面的方法可以试一下。
首先用reshape命令改造一下数据集
然后
用reshape命令改造数据集,
我的数据集形式如下:
date id ret
2010-01-04 1
2010-01-05 1
2010-01-06 1
2010-01-04 2
2010-01-05 2
2010-01-06 2
2010-01-04 3
2010-01-05 3
2010-01-06 3
现在我希望将其改为:
date ret_1 ret_2 ret_3
2010-01-04
2010-01-05
2010-01-06
我用的命令:reshape wide ret, j(date)string i(id)
可是显示错误。。。id is numeric
r(109);
这是为什么呢?
如果用 reshape wide ret, i(id) j(date) string
返回date not unique within id;
there are multiple observations at the same date within id.
Type "reshape error" for a listing of the problem observations.
请教各位同学是什么问题呢?