楼主: zabbyy
1207 10

[数据管理求助] 数据处理求助 [推广有奖]

  • 6关注
  • 4粉丝

已卖:171份资源

讲师

80%

还不是VIP/贵宾

-

威望
0
论坛币
222 个
通用积分
258.9018
学术水平
19 点
热心指数
21 点
信用等级
9 点
经验
99414 点
帖子
498
精华
0
在线时间
684 小时
注册时间
2015-12-27
最后登录
2026-2-2

楼主
zabbyy 发表于 2018-5-22 12:48:49 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
----------------------- copy starting from the next line -----------------------
  1. * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input str11 firmid
  4. "1101910081"
  5. "1101910081"
  6. "1101910081"
  7. "1101910081"
  8. "1101910081"
  9. "1101910081"
  10. "1101910081"
  11. "1101910091"
  12. "1101910091"
  13. "1101910091"
  14. "1101910091"
  15. "1101910091"
  16. "1101910095"
  17. "1101910097"
  18. "1101910097"
  19. "1101910097"
  20. "1101910097"
  21. "1101910097"
  22. "1101910097"
  23. "1101910104"
  24. "1101910104"
  25. "1101910104"
  26. "1101910104"
  27. "1101910104"
  28. "1101910104"
  29. "1101910104"
  30. "1101910105"
  31. "1101910105"
  32. "1101910105"
  33. "1101910105"
  34. "1101910105"
  35. "1101910105"
  36. "1101910106"
  37. "1101910106"
  38. "1101910106"
  39. "1101910107"
  40. "1101910107"
  41. "1101910107"
  42. "1101910107"
  43. "1101910107"
  44. "1101910107"
  45. "1101910107"
  46. "1101910112"
  47. "1101910112"
  48. "1101910112"
  49. "1101910112"
  50. "1101910112"
  51. "1101910112"
  52. "1101910112"
  53. "1101910114"
  54. "1101910114"
  55. "1101910120"
  56. "1101910123"
  57. "1101910129"
  58. "1101910129"
  59. "1101910129"
  60. "1101910129"
  61. "1101910129"
  62. "1101910129"
  63. "1101910129"
  64. "1101910133"
  65. "1101910133"
  66. "1101910133"
  67. "1101910133"
  68. "1101910133"
  69. "1101910133"
  70. "1101910135"
  71. "1101910151"
  72. "1101910151"
  73. "1101910164"
  74. "1101910164"
  75. "1101910164"
  76. "1101910164"
  77. "1101910164"
  78. "1101910164"
  79. "1101910164"
  80. "1101910187"
  81. "1101910187"
  82. "1101910187"
  83. "1101910187"
  84. "1101910190"
  85. "1101910190"
  86. "1101910191"
  87. "1101910191"
  88. "1101910191"
  89. "1101910191"
  90. "1101910191"
  91. "1101910191"
  92. "1101910191"
  93. "1101910198"
  94. "1101910201"
  95. "1101910201"
  96. "1101910201"
  97. "1101910201"
  98. "1101910201"
  99. "1101910203"
  100. "1101910203"
  101. "1101910203"
  102. "1101910203"
  103. "1101910203"
  104. end
复制代码

------------------ copy up to and including the previous line ------------------

Listed 100 out of 200000 observations
Use the count() option to list more

firmid为企业代码,字符型变量,我想控制企业固定效应,需要转变为数值型变量,但是由于数据200+万,所以encode命令不能用。
请问各位大神,还有其他的办法吗?谢谢各位!!


二维码

扫码加我 拉你入群

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

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

关键词:数据处理 install stall count line

越努力 越幸运

沙发
逍遥梦蝶 发表于 2018-5-22 15:17:57
2 million+ rows are due to the duplicates of firmid, so you could try keep firmid without duplicates and then encode it. Then, merge the encoded firmid to the original data.
  1. keep firmid
  2. duplicates drop
  3. encode firmid, gen(firmid_cd)
  4. save firmid_cd, replace

  5. use original_data, clear
  6. merge m:1 firmid using firmid_cd
复制代码
已有 1 人评分论坛币 学术水平 热心指数 信用等级 收起 理由
zabbyy + 5 + 2 + 1 + 1 精彩帖子

总评分: 论坛币 + 5  学术水平 + 2  热心指数 + 1  信用等级 + 1   查看全部评分

藤椅
黃河泉 在职认证  发表于 2018-5-22 15:43:52
也可试试
  1. egen id = group(firmid)
  2. reghdfe y x1 x2 ..., a(id)
复制代码
已有 1 人评分论坛币 学术水平 热心指数 信用等级 收起 理由
zabbyy + 5 + 2 + 1 + 1 精彩帖子

总评分: 论坛币 + 5  学术水平 + 2  热心指数 + 1  信用等级 + 1   查看全部评分

板凳
zabbyy 发表于 2018-5-22 16:43:42
逍遥梦蝶 发表于 2018-5-22 15:17
2 million+ rows are due to the duplicates of firmid, so you could try keep firmid without duplicates ...
我就是这么做的,谢谢你

报纸
zabbyy 发表于 2018-5-22 16:44:17
黃河泉 发表于 2018-5-22 15:43
也可试试
好  我马上试一下 谢谢黄老师

地板
黃河泉 在职认证  发表于 2018-5-22 16:52:21
zabbyy 发表于 2018-5-22 16:44
好  我马上试一下 谢谢黄老师
请告诉我执行情况如何?时间不会花太长吧?

7
jeffyangsir 在职认证  发表于 2018-5-22 16:57:49

8
zabbyy 发表于 2018-5-22 16:58:46
黃河泉 发表于 2018-5-22 15:43
也可试试
试过了,非常好的方法,谢谢黄老师指点

9
zabbyy 发表于 2018-5-22 17:30:49
黃河泉 发表于 2018-5-22 16:52
请告诉我执行情况如何?时间不会花太长吧?
. egen id = group(firmid)
r; t=7.03 17:30:00
这是执行时间
很快的  就7秒钟而已

10
黃河泉 在职认证  发表于 2018-5-22 18:49:31
zabbyy 发表于 2018-5-22 17:30
. egen id = group(firmid)
r; t=7.03 17:30:00
这是执行时间
Got it and thanks.

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-2-13 11:20