楼主: 零点晓敏
7586 7

[数据管理求助] 应该merge还是append? [推广有奖]

  • 18关注
  • 0粉丝

已卖:7份资源

博士生

30%

还不是VIP/贵宾

-

威望
0
论坛币
173 个
通用积分
36.8395
学术水平
1 点
热心指数
3 点
信用等级
1 点
经验
16264 点
帖子
187
精华
0
在线时间
284 小时
注册时间
2013-10-17
最后登录
2025-5-23

楼主
零点晓敏 学生认证  发表于 2014-3-3 21:03:43 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
在“外来务工人员调查表(新住户)”中的E3部分(问卷第23页)户主与配偶的父母的基本信息这个部分和问卷中的其他信息合并,是不是应该用merge命令啊?但是为什么用merge命令合并之后显示match的个数为0呢?求救!!是不是应该用append命令呢?

merge m:m hhcode using "D:\三年数据\data\2009\rumic_2009_data\MHSn_w2_e3.dta"
(label city already defined)

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,516
        from master                     5,426  (_merge==1)
        from using                         90  (_merge==2)

    matched                                 0  (_merge==3)
    -----------------------------------------


二维码

扫码加我 拉你入群

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

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

关键词:append Merge End App Pen 务工人员 already master 调查表 信息

回帖推荐

jjjj6666 发表于6楼  查看完整内容

It's surprise, that the two data have no common household id. you can use append, but you have missing information in the combined data, which may not help you in answering your research question if it relies on merged data.

沙发
jjjj6666 发表于 2014-3-4 03:22:49
the data may have problem in var hhcode if they two data suppose to share share the same hhcode.  If not, you cannot use merge since no common id.

藤椅
蓝色 发表于 2014-3-4 07:52:58
肯定是merge

但请提供2个数据的编码的变量
自己看看就知道是否可以merge了

板凳
零点晓敏 学生认证  发表于 2014-3-4 09:27:57
蓝色 发表于 2014-3-4 07:52
肯定是merge

但请提供2个数据的编码的变量
请问您说的是hhcode吗?两个数据的共同编码变量就只有hhcode,我tab了一下,没有相同的量,该怎么办呢?

tab hhcode

      ID of |
  household |
       2009 |      Freq.     Percent        Cum.
------------+-----------------------------------
      10084 |          2        2.22        2.22
      20003 |          2        2.22        4.44
      20010 |          2        2.22        6.67
      20039 |          2        2.22        8.89
      20134 |          2        2.22       11.11
      30020 |          2        2.22       13.33
      30092 |          2        2.22       15.56
      30304 |          3        3.33       18.89
      40006 |          2        2.22       21.11
      40012 |          2        2.22       23.33
      40129 |          2        2.22       25.56
      40216 |          2        2.22       27.78
      40254 |          2        2.22       30.00
      50063 |          2        2.22       32.22
      60046 |          2        2.22       34.44
      60134 |          2        2.22       36.67
      60143 |          2        2.22       38.89
      60300 |          2        2.22       41.11
      60302 |          2        2.22       43.33
      60343 |          3        3.33       46.67
      70054 |          2        2.22       48.89
      70055 |          2        2.22       51.11
      70061 |          2        2.22       53.33
      70180 |          2        2.22       55.56
      80046 |          2        2.22       57.78
      80174 |          2        2.22       60.00
      80296 |          2        2.22       62.22
      90148 |          2        2.22       64.44
      90243 |          3        3.33       67.78
      90502 |          3        3.33       71.11
     120057 |          2        2.22       73.33
     120265 |          2        2.22       75.56
     130042 |          2        2.22       77.78
     130113 |          2        2.22       80.00
     130135 |          2        2.22       82.22
     140150 |          2        2.22       84.44
     140201 |          2        2.22       86.67
     140249 |          2        2.22       88.89
     140363 |          2        2.22       91.11
     140399 |          2        2.22       93.33
     150289 |          2        2.22       95.56
     150298 |          2        2.22       97.78
     150377 |          2        2.22      100.00
------------+-----------------------------------
      Total |         90      100.00

tab hhcode

      ID of |
  household |
       2009 |      Freq.     Percent        Cum.
------------+-----------------------------------
      10590 |          4        0.04        0.04
      10594 |          4        0.04        0.08
      10595 |          3        0.03        0.11
      10597 |          2        0.02        0.13
      10598 |          3        0.03        0.16
      10599 |          2        0.02        0.19
      10600 |          2        0.02        0.21
      10601 |          4        0.04        0.25
      10602 |          2        0.02        0.27
      10603 |          4        0.04        0.31
      10604 |          2        0.02        0.33
      10605 |          4        0.04        0.37
      10606 |          4        0.04        0.41
      10607 |          4        0.04        0.45
      10608 |          4        0.04        0.49
      10609 |          4        0.04        0.54
      10610 |          2        0.02        0.56
      10611 |          3        0.03        0.59
      10612 |          2        0.02        0.61
      10613 |          2        0.02        0.63
      10614 |          3        0.03        0.66
      10615 |          2        0.02        0.68
      10616 |          2        0.02        0.70
      10617 |          4        0.04        0.74
      10618 |          4        0.04        0.78
      10619 |          2        0.02        0.80
      10620 |          1        0.01        0.81
      10621 |          2        0.02        0.84
      10622 |          4        0.04        0.88
      10623 |          4        0.04        0.92
      10624 |          3        0.03        0.95
      10625 |          3        0.03        0.98
      10626 |          3        0.03        1.01
      10627 |          4        0.04        1.05
      10628 |          2        0.02        1.07
      10630 |          2        0.02        1.09
      10631 |          2        0.02        1.11
      10632 |          3        0.03        1.14
      10633 |          1        0.01        1.15
      10634 |          3        0.03        1.19
      10635 |          1        0.01        1.20
      10636 |          1        0.01        1.21
      10637 |          1        0.01        1.22
      10638 |          2        0.02        1.24
      10639 |          3        0.03        1.27
      10640 |          1        0.01        1.28
      10641 |          2        0.02        1.30
      10642 |          2        0.02        1.32
      10643 |          2        0.02        1.34
      10644 |          2        0.02        1.36
      10645 |          2        0.02        1.38
      10646 |          2        0.02        1.40
      10647 |          2        0.02        1.42
      10648 |          2        0.02        1.44
      10649 |          2        0.02        1.46
      10650 |          2        0.02        1.48
      10651 |          1        0.01        1.50
      10652 |          1        0.01        1.51
      10654 |          2        0.02        1.53
      10655 |          2        0.02        1.55
      10656 |          3        0.03        1.58
      10657 |          2        0.02        1.60
      10658 |          2        0.02        1.62
      10659 |          2        0.02        1.64
      10660 |          4        0.04        1.68
      10661 |          2        0.02        1.70
      10662 |          2        0.02        1.72
      10663 |          1        0.01        1.73
      10664 |          3        0.03        1.76
      10667 |          3        0.03        1.79
      10668 |          2        0.02        1.81
      10669 |          2        0.02        1.84
      10670 |          2        0.02        1.86
      10671 |          2        0.02        1.88
      10672 |          3        0.03        1.91
      10673 |          2        0.02        1.93
      10674 |          1        0.01        1.94
      10675 |          1        0.01        1.95
      10676 |          6        0.06        2.01
      10677 |          3        0.03        2.04
      10678 |          2        0.02        2.06
      10679 |          5        0.05        2.11
      10680 |          2        0.02        2.13
      10681 |          1        0.01        2.14
      10682 |          2        0.02        2.17
      10683 |          2        0.02        2.19
      10684 |          1        0.01        2.20
      10685 |          2        0.02        2.22
      10686 |          2        0.02        2.24
      10687 |          1        0.01        2.25
      10688 |          2        0.02        2.27
      10689 |          2        0.02        2.29
      10690 |          2        0.02        2.31
      10691 |          2        0.02        2.33
      10692 |          2        0.02        2.35
      10693 |          1        0.01        2.36
      10694 |          2        0.02        2.38
      10695 |          3        0.03        2.41
      10696 |          2        0.02        2.43
      10697 |          1        0.01        2.44
      10698 |          2        0.02        2.46
      10699 |          2        0.02        2.49
      10700 |          2        0.02        2.51
      10701 |          2        0.02        2.53
      10702 |          1        0.01        2.54
      10703 |          2        0.02        2.56
      10704 |          2        0.02        2.58
      10705 |          1        0.01        2.59
      10706 |          2        0.02        2.61
      10707 |          2        0.02        2.63
      10708 |          2        0.02        2.65
      10709 |          2        0.02        2.67
      10710 |          2        0.02        2.69
      10711 |          2        0.02        2.71
      10712 |          2        0.02        2.73
      10713 |          3        0.03        2.76
      10714 |          2        0.02        2.78
      10715 |          1        0.01        2.79
      10716 |          2        0.02        2.82
      10717 |          2        0.02        2.84
      10718 |          2        0.02        2.86
      10719 |          4        0.04        2.90
      10720 |          2        0.02        2.92
      10721 |          5        0.05        2.97
      10722 |          2        0.02        2.99
      10723 |          2        0.02        3.01
      10724 |          2        0.02        3.03
      10725 |          2        0.02        3.05
      10726 |          1        0.01        3.06
      10727 |          1        0.01        3.07
      10728 |          1        0.01        3.08
      10729 |          2        0.02        3.10
      10730 |          1        0.01        3.11
      10731 |          2        0.02        3.13
      10732 |          1        0.01        3.15
      10733 |          1        0.01        3.16
      10734 |          1        0.01        3.17
      10735 |          1        0.01        3.18
      10736 |          1        0.01        3.19
      10737 |          2        0.02        3.21
      10738 |          1        0.01        3.22
      10739 |          2        0.02        3.24
      10740 |          2        0.02        3.26
      10741 |          2        0.02        3.28
      10742 |          4        0.04        3.32
      10743 |          2        0.02        3.34
      10744 |          2        0.02        3.36
      10745 |          3        0.03        3.39
      10746 |          3        0.03        3.42
      10747 |          2        0.02        3.44
      10748 |          1        0.01        3.45
      10749 |          1        0.01        3.46
      10750 |          2        0.02        3.49
      10751 |          1        0.01        3.50
      10752 |          2        0.02        3.52
      10753 |          2        0.02        3.54
      10754 |          3        0.03        3.57
      10755 |          2        0.02        3.59
      10756 |          2        0.02        3.61
      10757 |          2        0.02        3.63
      10758 |          1        0.01        3.64
      10759 |          1        0.01        3.65
      10760 |          1        0.01        3.66
      10761 |          2        0.02        3.68
      10762 |          2        0.02        3.70
      10763 |          1        0.01        3.71
      10764 |          2        0.02        3.73
      10765 |          2        0.02        3.75
      10766 |          2        0.02        3.77
      10767 |          2        0.02        3.79
      10768 |          2        0.02        3.82
      10769 |          5        0.05        3.87
      10770 |          2        0.02        3.89
      10771 |          2        0.02        3.91
      10772 |          2        0.02        3.93
      10773 |          1        0.01        3.94
      10774 |          1        0.01        3.95
      10775 |          3        0.03        3.98
      10776 |          2        0.02        4.00
      10777 |          1        0.01        4.01
      10778 |          1        0.01        4.02
      10779 |          2        0.02        4.04
      10780 |          2        0.02        4.06
      10781 |          1        0.01        4.07
      10782 |          2        0.02        4.09
      10783 |          3        0.03        4.12
      10784 |          1        0.01        4.14
      10785 |          2        0.02        4.16
      10786 |          2        0.02        4.18
      10787 |          2        0.02        4.20
      10788 |          1        0.01        4.21
      10789 |          1        0.01        4.22
      10790 |          1        0.01        4.23
      10791 |          1        0.01        4.24
      10792 |          4        0.04        4.28
      10793 |          2        0.02        4.30
      10794 |          2        0.02        4.32
      10795 |          1        0.01        4.33
      10796 |          1        0.01        4.34
      10797 |          2        0.02        4.36
      10798 |          1        0.01        4.37
      10799 |          4        0.04        4.41
      10800 |          3        0.03        4.44
      10801 |          2        0.02        4.47
      10802 |          1        0.01        4.48
      10803 |          1        0.01        4.49
      10804 |          2        0.02        4.51
      10805 |          2        0.02        4.53
      10806 |          1        0.01        4.54
      10807 |          1        0.01        4.55
      10808 |          2        0.02        4.57
      10809 |          2        0.02        4.59
      10810 |          2        0.02        4.61
      10811 |          2        0.02        4.63
      10812 |          2        0.02        4.65
      10816 |          2        0.02        4.67
      10817 |          2        0.02        4.69
      10819 |          1        0.01        4.70
      10821 |          2        0.02        4.72
      10822 |          2        0.02        4.74
      10823 |          2        0.02        4.76
      10826 |          1        0.01        4.77
      10827 |          4        0.04        4.82
      10828 |          5        0.05        4.87
      10829 |          1        0.01        4.88
      10830 |          6        0.06        4.94
      10831 |          4        0.04        4.98
      10832 |          2        0.02        5.00

报纸
零点晓敏 学生认证  发表于 2014-3-4 09:30:50
jjjj6666 发表于 2014-3-4 03:22
the data may have problem in var hhcode if they two data suppose to share share the same hhcode.  If ...
恩 两个数据的hhcode不同,在种情况下,请问我能用append命令吗?

地板
jjjj6666 发表于 2014-3-4 10:38:35
It's surprise, that the two data have no common household id.

you can use append, but you have missing information in the combined data, which may not help you in answering your research question if it relies on merged data.
已有 1 人评分论坛币 学术水平 热心指数 收起 理由
SpencerMeng + 20 + 1 + 1 精彩帖子

总评分: 论坛币 + 20  学术水平 + 1  热心指数 + 1   查看全部评分

7
零点晓敏 学生认证  发表于 2014-3-4 20:08:06
jjjj6666 发表于 2014-3-4 10:38
It's surprise, that the two data have no common household id.

you can use append, but you have mi ...
非常感谢!!

8
mark8865 发表于 2015-5-31 14:18:25
正在学习stata,谢谢分享。

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-1 19:36