楼主: novice07
34684 24

[学习心得] 【转】“repeated time values within panel”问题的解决 [推广有奖]

21
fengy1001 发表于 2019-7-18 18:07:22
解决问题。谢谢!

22
3170101965 学生认证  发表于 2019-12-26 10:23:21
学习笔记1. Do identifier and time uniquely identify the data?Observations in panel data are uniquely identified by the combination of identifier and year.

代码:. isid id time  //检验id和year是否是唯一标识,即是否有重复观测值
结果1no news is good news
结果2:variables ctnm_id year do not uniquely identify the observations
r(459);
——确实有重复
2. using the duplicates command, which is a small bundle of tools for investigating possible problems arising from duplicated observations.  

. duplicates report ctnm_id year    //查找重复的个数


Duplicates in terms of ctnm_id year


--------------------------------------
   copies | observations       surplus
----------+---------------------------
        1 |          551             0
        2 |            2             1
--------------------------------------
. duplicates list ctnm_id year    //查找重复的观测值


Duplicates in terms of ctnm_id year


  +-----------------------+
  | obs:   ctnm_id   year |
  |-----------------------|
  |  524    610400   2013 |
  |  525    610400   2013 |
  +-----------------------+








23
qingqingzuibang 发表于 2020-3-26 22:36:19
太棒了!非常感谢。多亏了这些操作解决了棘手的问题

24
Zhang707379846 学生认证  发表于 2020-4-2 11:43:27
很棒,刚遇到这个问题

25
Adolf云亮 发表于 2020-4-2 12:27:09
写的太棒了

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

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