楼主: JokerZhouS
1390 8

[数据管理求助] reshape命令问题 [推广有奖]

  • 3关注
  • 1粉丝

本科生

31%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
26.8728
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
445 点
帖子
34
精华
0
在线时间
127 小时
注册时间
2023-5-23
最后登录
2025-7-11

楼主
JokerZhouS 发表于 2023-12-4 11:28:48 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
我用reshpe进行数据转置,结果却显示这样
values of variable year not unique within hhcode
    Your data are currently long.  You are performing a reshape wide.  You
    specified i(hhcode) and j(year).  There are observations within i(hhcode)
    with the same value of j(year).  In the long data, variables i() and j()
    together must uniquely identify the observations.

但是我的年份和我的身份代码是一一对应的,结果还是不成功

二维码

扫码加我 拉你入群

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

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

关键词:reshape Shape APE RES observations

沙发
蓝色 发表于 2023-12-4 13:43:26
用这里方法提供数据才能知道原因


让巧妇有米可炊 (提問時,如何附上適當的資料)
https://bbs.pinggu.org/forum.php ... 204&from^^uid=902

藤椅
陈小丽 发表于 2023-12-4 20:54:44
这个报错不是很明显么?不能用reshape long,要用reshape wide
stata数据分析交流3群 706059301

板凳
JokerZhouS 发表于 2023-12-5 12:03:55
陈小丽 发表于 2023-12-4 20:54
这个报错不是很明显么?不能用reshape long,要用reshape wide
stata数据分析交流3群 706059301
我用的就是wide

报纸
nieqiang110 学生认证  发表于 2023-12-6 08:01:12
检查识别变量和时间变量的格式,格式错误,也无法运行

地板
HappyAndy_Lo 发表于 2023-12-6 08:54:20
In the long data, variables i() and j()
    together must uniquely identify the observations.
这说明,你的i、j不能唯一标识一行数据

我的理解

7
albertwishedu 发表于 2023-12-6 08:54:50

8
JokerZhouS 发表于 2023-12-8 14:27:05
已经解决了  duplicates命令

9
鹿天爱菜 发表于 2024-3-21 15:45:48
JokerZhouS 发表于 2023-12-8 14:27
已经解决了  duplicates命令
我用了 不太懂什么意思 怎么解决啊
duplicates report hs

Duplicates in terms of hs

--------------------------------------
   copies | observations       surplus
----------+---------------------------
        1 |          105             0
        2 |          168            84
        3 |          228           152
        4 |          288           216
        5 |          340           272
        6 |          510           425
        7 |          511           438
        8 |          632           553
        9 |          648           576
       10 |          740           666
       11 |          792           720
       12 |          852           781
       13 |         1053           972
       14 |         1176          1092
       15 |         1185          1106
       16 |         1568          1470
       17 |         1819          1712
       18 |         1962          1853
       19 |         2413          2286
       20 |         2120          2014
       21 |         2646          2520
       22 |         3300          3150
       23 |         3634          3476
       24 |         3816          3657
       25 |         5225          5016
       26 |         5590          5375
       27 |         6777          6526
       28 |         9520          9180
       29 |        11078         10696
       30 |        11340         10962
       31 |        11036         10680
       33 |           33            32
       36 |           72            70
       38 |           38            37
       43 |           43            42
       50 |           50            49
       57 |           57            56
       71 |           71            70
       96 |           96            95
--------------------------------------

.

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

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