楼主: Ranqiuqiu
3956 4

[面板数据求助] merge合并时数据老是被重复,新手已经倒腾了一天了求解救 [推广有奖]

  • 0关注
  • 0粉丝

小学生

21%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
30 点
帖子
1
精华
0
在线时间
9 小时
注册时间
2017-12-31
最后登录
2019-7-8

楼主
Ranqiuqiu 发表于 2017-12-31 00:43:32 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
year        id        q3ds(F:\stata\A1)
2006        000001        11380000
2006        000002        10160000
2006        000004        570000
2006        000005        480000
2006        000006        2055100


year        id        gsgm        zczzl(F:\stata\B1)
2006        000002        48507917571        0.367944269
2006        000004        204304637.7        0.223386987
2006        000005        1528293792        0.214659163
2006        000006        2918925351        0.429794888
2006        000007        805877586.4        0.240411026
我想把这两个表合并在一起,用了这个
use F:\Stata12\A1.dta, clear
merge 1:1 id using F:\Stata12\B1.dta
但是一直合并不了  而且还会冒出好几个id000001、000002
---------------------------------------------------------------------------------------------
search for r(459)                                                       (manual:  [R] search)
---------------------------------------------------------------------------------------------

        Keywords:  r(459)
          Search:  (1) Official help files, FAQs, Examples, SJs, and STBs


Search of official help files, FAQs, Examples, SJs, and STBs

[P]     error . . . . . . . . . . . . . . . . . . . . . . . .  Return code 459
        something that should be true of your data is not;
        data have changed since estimation;
        This is the generic form of this message; more likely, you
        will see messages such as "y must be between 0 and 1" or
        "x not positive".  You have attempted to do something that,
        given your data, does not make sense.

(end of search)
求帮忙,期末作业,崩溃了,感谢
二维码

扫码加我 拉你入群

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

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


沙发
黃河泉 在职认证  发表于 2017-12-31 07:28:48
试试
  1. use F:\Stata12\A1.dta, clear
  2. merge 1:1 id year using F:\Stata12\B1.dta
复制代码

藤椅
黃河泉 在职认证  发表于 2017-12-31 07:29:19
建议请用 dataex (先 ssc install dataex 并见说明) 将原始 Stata 资料中具有”代表性”的一部分资料列出,以供有意回答者实验之用,并能提供具体操作指令。并请参考 http://www.jianshu.com/p/9870080fe769,  https://bbs.pinggu.org/thread-5048204-1-1.html, 与 https://bbs.pinggu.org/thread-5917273-1-1.html

板凳
MYZ082609 发表于 2018-1-6 12:08:00
use F:\Stata12\A1.dta, clear
merge m:m id year using "F:\Stata12\B1.dta"

报纸
丹心舞雪 在职认证  发表于 2018-1-6 12:56:25
数据不全,而且楼主没有贴出output。如果只需要保留部分数据(例如matched,或者master数据),可以用option keep()。
keep()用法和assert()类似,中间加需要的数据代号。相关帮助文档如下

           Numeric    Equivalent
            code      word (results)     Description
           -------------------------------------------------------------------
              1       master             observation appeared in master only
              2       using              observation appeared in using only
              3       match              observation appeared in both

              4       match_update       observation appeared in both,
                                           missing values updated
              5       match_conflict     observation appeared in both,
                                           conflicting nonmissing values
           -------------------------------------------------------------------

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-30 21:24