楼主: xyntc
12853 4

[面板数据求助] xtset company year repeated time values within panel r(451); [推广有奖]

  • 0关注
  • 0粉丝

等待验证会员

学前班

60%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
20 点
帖子
1
精华
0
在线时间
2 小时
注册时间
2013-4-14
最后登录
2013-5-6

楼主
xyntc 发表于 2013-4-14 17:01:22 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
724个公司,91个月,变量有股票价格,汇率变化,市场指数。
数据是这样的
company   year   SR   TR   KSTR   
600028    200509    -5.455200    -0.0012   -0.6669   
600028    200510    -5.084700    -0.00041   -5.3645   
600028    200511    4.846900    -0.00061   0.5754   
600028    200512    13.382000    -0.001   5.663   
600028    200601    6.867000    -0.00113   8.025   
600028    200602    6.224900    -0.00216   3.3078   
600028    200603    -4.536900    -0.00177   -0.0888   
600028    200604    20.198000    -0.00242   11.0469   
600028    200605    6.425000    -5.2E-05   14.0652   
600028    200606    -1.741700    -0.00106   1.9559   
600028    200607    -7.520000    -0.00197   -3.5787   ····
···
就是前面是公司代码,时间是从200509-201303
用duplicate
. duplicates report company year
Duplicates in terms of company year
--------------------------------------
   copies | observations       surplus
----------+---------------------------
        1 |        65880             0
        2 |            4             2
--------------------------------------
. duplicates list company year
Duplicates in terms of company year
  +----------------------------------+
  | group:   obs:   company     year |
  |----------------------------------|
  |      1      1    600028   200509 |
  |      1     92    600028   200509 |
  |      2      2    600028   200510 |
  |      2     93    600028   200510 |
  +----------------------------------+
. duplicates in terms of company year
illegal duplicates subcommand
r(198);
. duplicates in terms of company year
illegal duplicates subcommand
r(198);
. duplicates tag company year, gen(isdup)
Duplicates in terms of company year
. edit if isdup
. drop isdup
. duplicates report company year
Duplicates in terms of company year
--------------------------------------
   copies | observations       surplus
----------+---------------------------
        1 |        65880             0
        2 |            4             2
--------------------------------------
. duplicates list company year
Duplicates in terms of company year
  +----------------------------------+
  | group:   obs:   company     year |
  |----------------------------------|
  |      1      1    600028   200509 |
  |      1     92    600028   200509 |
  |      2      2    600028   200510 |
  |      2     93    600028   200510 |
  +----------------------------------+
. duplicates tag company year, gen(isdup)
Duplicates in terms of company year
. edit if isdup
. drop isdup

. xtset company year
repeated time values within panel
r(451);

怎么解决呢 是哪一步错了?
二维码

扫码加我 拉你入群

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

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

关键词:Repeated company repeat compan within 451 repeated company values within

沙发
Messizsw 发表于 2013-4-15 21:54:42
我曾经也出现过这样的问题。
出现重复值,需要强行剔除。
duplicates drop company year, force
再xtest company year, yearly

应该ok,希望有用

藤椅
七月流水 发表于 2016-8-4 20:44:30
Messizsw 发表于 2013-4-15 21:54
我曾经也出现过这样的问题。
出现重复值,需要强行剔除。
duplicates drop company year, force
用这个语句没有发现重复的情况,这种情况怎么解决呢?

板凳
jiang01 发表于 2019-10-10 21:33:44
七月流水 发表于 2016-8-4 20:44
用这个语句没有发现重复的情况,这种情况怎么解决呢?
是啊,这个要怎么解决呀楼主

报纸
2016103324 发表于 2020-2-5 22:39:41
七月流水 发表于 2016-8-4 20:44
用这个语句没有发现重复的情况,这种情况怎么解决呢?
请问您最后解决了吗,可以向您请教吗?

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

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