全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
4677 19
2020-08-02
原始数据为两年CHFS家庭数据库中的数据,希望将其重整为面板数据,进行PSM-DID分析。依据hhid匹配,处理组(1)与对照组(0)的区分依靠year2015变量识别,数据示例如下:目前解决思路为,(1)仅保留每一年的户主数据,将两年数据进行1:1匹配,形成类似如下的宽数据
图片1.png
(2)宽变长:reshape wide variable,i(hhid)j(year)
错误代码no; data are mi set    Use mi reshape to perform reshape on these data.  mi reshape has the same syntax as reshape.


    Perhaps you did not type reshape.  In that case, the command you typed calls reshape and it is not
    appropriate for use with mi data.  Use mi extract or mi xeq to select the data on which you want to
    run the command, which is probably m=0.
r(119);
感谢老师们的解答!
部分原始数据示例:
图片7.png 图片6.png

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2020-8-2 11:36:24
比如说家庭数据在两个文件里分别匹配好的,但出现了
附件列表
图片2.png

原图尺寸 190.68 KB

图片2.png

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-8-2 12:16:17
每个家庭id人数变多了,数也全乱了
附件列表
图片3.png

原图尺寸 305.45 KB

图片3.png

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-8-2 15:39:52
感觉你问题描述的不太清楚,还有你要附上部分数据
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-8-2 18:57:06
建议用dataex命令给出示例数据,重新描述一下问题。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-8-3 08:50:37
id是多对多,应该是m:m呀。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群