楼主: ljt19961998
868 4

[编程问题求助] 如何对用同行企业披露业绩预告( 包括年度业绩预告和季度业绩预告) 数量的均值来表示 [推广有奖]

  • 1关注
  • 1粉丝

硕士生

36%

还不是VIP/贵宾

-

威望
0
论坛币
67 个
通用积分
27.6821
学术水平
1 点
热心指数
1 点
信用等级
1 点
经验
1075 点
帖子
77
精华
0
在线时间
187 小时
注册时间
2022-2-24
最后登录
2024-6-21

楼主
ljt19961998 在职认证  学生认证  发表于 2022-11-18 21:11:45 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
请问如何对除了自己(目标公司)之外的同行披露的盈利预测的披露数量进行加总,原文意思是[size=10.2857pt]用同行企业披露业绩预告( 包括年度业绩预告[size=10.2857pt]和季度业绩预告) 数量的均值来表示[size=10.2857pt]。求问如何编写代码。其中PubliDate是业绩预告发布日,accper是业绩预告披露所属会计期间  ind是行业代码
----------------------- copy starting from the next line -----------------------
  1. * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input long StockCode int PubliDate float accper str3 ind
  4. 6 21287 21274 "K"  
  5. 6 21378 21365 "K"  
  6. 6 22383 22370 "K"  
  7. 6 22475 22461 "K"  
  8. 7 21580 21549 "K"  
  9. 7 21837 21822 "K"  
  10. 7 21931 21914 "K"  
  11. 7 21931 21914 "K"  
  12. 7 22020 22005 "K"  
  13. 7 22111 22096 "K"  
  14. 7 22203 22188 "K"  
  15. 7 22385 22370 "K"  
  16. 7 22476 22461 "K"  
  17. 7 22568 22553 "K"  
  18. 7 22672 22645 "K"  
  19. 8 21580 21549 "C37"
  20. 8 22111 22096 "C37"
  21. 8 22203 22188 "C37"
  22. 8 22385 22370 "C37"
  23. 8 22476 22461 "C37"
  24. 8 22568 22553 "C37"
  25. 10 21473 21457 "E"  
  26. 10 21579 21549 "E"  
  27. 10 21837 21822 "E"  
  28. 10 21935 21914 "E"  
  29. 10 22385 22370 "E"  
  30. 11 21286 21274 "K"  
  31. 11 21376 21365 "K"  
  32. 11 21467 21457 "K"  
  33. 11 22015 22005 "K"  
  34. 11 22474 22461 "K"  
  35. 11 22566 22553 "K"  
  36. 12 22385 22370 "C30"
  37. 12 22467 22461 "C30"
  38. 12 22568 22553 "C30"
  39. 14 21284 21274 "K"  
  40. 14 21572 21549 "K"  
  41. 14 21651 21639 "K"  
  42. 14 21741 21730 "K"  
  43. 14 21937 21914 "K"  
  44. 14 22111 22096 "K"  
  45. 14 22201 22188 "K"  
  46. 14 22384 22370 "K"  
  47. 14 22476 22461 "K"  
  48. 14 22567 22553 "K"  
  49. 14 22672 22645 "K"  
  50. 16 21651 21639 "C39"
  51. 16 22020 22005 "C39"
  52. 16 22111 22096 "C39"
  53. 16 22385 22370 "C39"
  54. 16 22568 22553 "C39"
  55. 16 22670 22645 "C39"
  56. 17 22385 22280 "C37"
  57. 17 22385 22280 "C37"
  58. 17 22475 22461 "C37"
  59. 17 22568 22553 "C37"
  60. 18 21290 21274 "E"  
  61. 18 21579 21549 "E"  
  62. 18 21655 21639 ""   
  63. 18 21837 21822 ""   
  64. 19 21580 21549 "C15"
  65. 19 21837 21822 "F"  
  66. 19 22385 22370 "F"  
  67. 20 22476 22461 "C39"
  68. 20 22568 22553 "C39"
  69. 21 22203 22188 "C39"
  70. 21 22309 22280 "C39"
  71. 23 21742 21730 "C30"
  72. 23 21837 21822 "C30"
  73. 23 21935 21914 "C30"
  74. 23 22020 22005 "C30"
  75. 23 22111 22096 "C30"
  76. 23 22203 22188 "C30"
  77. 23 22385 22370 "C30"
  78. 23 22476 22461 "C30"
  79. 23 22568 22553 "C30"
  80. 25 21616 21549 "F"  
  81. 25 21837 21822 "F"  
  82. 25 22020 22005 "F"  
  83. 25 22110 22096 "F"  
  84. 25 22308 22280 "F"  
  85. 25 22384 22370 "F"  
  86. 25 22474 22461 "F"  
  87. 25 22567 22553 "F"  
  88. 25 22670 22645 "F"  
  89. 26 21579 21549 "F"  
  90. 26 22371 22370 "F"  
  91. 26 22565 22553 "F"  
  92. 27 21837 21822 "D"  
  93. 27 21929 21914 "D"  
  94. 27 22035 22096 "D"  
  95. 27 22111 22096 "D"  
  96. 27 22153 22188 "D"  
  97. 27 22203 22188 "D"  
  98. 27 22305 22280 "D"  
  99. 27 22385 22370 "D"  
  100. 29 22384 22370 "K"  
  101. 29 22399 22461 "K"  
  102. 30 22385 22370 "C36"
  103. 31 21371 21365 "K"  
  104. end
  105. format %tdnn/dd/CCYY PubliDate
  106. format %tdnn/dd/CCYY accper
复制代码

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



二维码

扫码加我 拉你入群

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

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

关键词:业绩预告 generated including generate Starting

回帖推荐

黃河泉 发表于4楼  查看完整内容

请先 ssc install rangestat,我算的是平均数 (你要的请对应改变),试试

沙发
黃河泉 在职认证  发表于 2022-11-19 10:12:58
1. 你的"业绩"资料呢?2. 应该是要同一产业 (排除本身),"同一年"吧?3. 是按照"业绩预告发布日"的那一年 (与 2. 之问题相关) 吗?

藤椅
ljt19961998 在职认证  学生认证  发表于 2022-11-19 11:13:13
黃河泉 发表于 2022-11-19 10:12
1. 你的"业绩"资料呢?2. 应该是要同一产业 (排除本身),"同一年"吧?3. 是按照"业绩预告发布日"的那一年 ( ...
----------------------- copy starting from the next line -----------------------
  1. * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input long StockCode int PubliDate float(accper q) long ind1 double(EPS_Low EPS_Hig)
  4.    932 21651 21639 236 20  .3449   .378
  5.    529 21650 21639 236  3   .046   .053
  6.   2331 22203 22188 242 37  .0977  .1173
  7.    708 21833 21822 238 20   1.22   1.25
  8.   2328 22385 22370 244 25  .0364  .0416
  9.    767 22385 22370 244 32  .0011  .0015
  10.    652 22020 22005 240 34      0  .0068
  11.    858 22714 22645 247  5      6      6
  12.   2331 22385 22370 244 37 -.0437 -.0291
  13.    528 22385 22370 244 24    .23    .31
  14.   2243 22110 22096 241 18  .1066  .1408
  15.    819 22384 22370 244 14   -.02  -.017
  16.   2658 22379 22370 244 29    .04    .05
  17.   2473 22385 22370 244 27 -.0268 -.0268
  18. 300078 22333 22280 243 28    .11    .16
  19. 300496 22377 22370 244 37  .2532   .269
  20.   2318 22384 22370 244 22  .1238  .1485
  21.     49 21930 21914 239 27 2.2845 2.5276
  22.    803 22020 22005 240 27   -.13    -.1
  23.    516 22385 22370 244 45   -.09   -.08
  24.   1979 22019 22005 240 39    .02    .04
  25.   2749 22111 22096 241 15    .34    .36
  26.    782 21937 21914 239 17    .04    .05
  27.     32 21377 21365 233 34  .1303  .1539
  28.   2539 22152 22188 242 15    .25    .29
  29. 300155 22298 22280 243 28    .18    .22
  30.     42 22020 22005 240 39 -.1494 -.0747
  31.   2337 22385 22370 244 24  -.008  -.004
  32.    789 21284 21274 232 19   .363   .368
  33.   2956 22385 22370 244  4    .31    .34
  34.   2310 22385 22370 244 42   -.18   -.14
  35.    426 22385 22370 244  2   .049   .068
  36.    786 22665 22645 247 19  2.032  2.202
  37.   2522 22385 22370 244 18  .0362  .0425
  38.   2334 22383 22370 244 27  .0425  .0491
  39.    965 22383 22370 244 39 -.0496 -.0405
  40.    810 21283 21274 232 28  .0532  .0773
  41.    534 21837 21822 238 16  .1444  .2135
  42.   2250 22383 22370 244 15    .09    .12
  43.   2056 22291 22280 243 27    .59    .65
  44.   2830 22665 22645 247 33    .19    .25
  45.     49 22475 22461 245 27  .8321  .9153
  46.    703 22004 22005 240 17    .23    .28
  47.    629 22377 22370 244 21  .0163  .0186
  48.    935 21287 21274 232 19   .127    .13
  49.     58 21292 21274 232 40  .0468   .055
  50. 300418 22561 22553 246 37   1.57   2.04
  51.   2717 22385 22370 244 42   .008   .012
  52. 300474 22467 22461 245 28    .38    .42
  53.   2311 22383 22370 244  3    .42    .47
  54.    960 21580 21549 235 21  .4974  .5333
  55.    758 22476 22461 245  2  .0559  .0726
  56.   2667 22111 22096 241 24    .03    .04
  57.   2345 22369 22370 244 30    .11    .12
  58.    651 22020 22005 240 27    .22    .28
  59.   2528 22385 22370 244 28 -.0601 -.0542
  60.   2346 22363 22370 244 27   .045   .063
  61.    338 21580 21549 235 25    .94   1.11
  62.    679 22020 22005 240 34   -.24   -.18
  63.   2713 22385 22370 244 33   -.55   -.45
  64.     12 22385 22370 244 19    .17     .2
  65.    613 22384 22370 244 36  .0026  .0032
  66.    893 22385 22370 244 15  .0203  .0259
  67.    831 22383 22370 244 21  .0978   .108
  68.   2869 22306 22280 243 28   3.26   3.67
  69.   2292 22376 22370 244 13   .016    .02
  70.    530 22385 22370 244 23  -.036   -.03
  71.    402 21837 21822 238 39    .44    .49
  72.    572 21287 21274 232 25   -.07   -.04
  73.   2915 22671 22645 247 15  .7899  .8132
  74.    158 22385 22370 244 37 -.0563 -.0532
  75.    927 22385 22370 244 34    .03    .04
  76.    899 21837 21822 238 32  .2597  .3174
  77.    415 22021 22005 240 40  .0518   .068
  78.    652 21286 21274 232 34 -.0122 -.0054
  79.    989 22295 22280 243 16    .31    .36
  80.   2286 22399 22461 245  3    .13    .18
  81.   2399 22111 22096 241 16  .4381  .4819
  82.    967 21580 21549 235 27    .36    .41
  83.   2285 22312 22280 243 39    .05    .06
  84.   2283 22369 22370 244 25    .14    .16
  85.   2250 22097 22096 241 15    .09    .13
  86.   2896 22383 22370 244 23     .2    .25
  87.    635 22203 22188 242 15    .12    .12
  88.   2880 22106 22096 241 16  .4354   .566
  89.    961 22293 22280 243 39   1.59   2.12
  90.   2559 22378 22370 244 23  .0553   .065
  91.    526 22111 22096 241 44  .3742  .5614
  92.    156 21934 21914 239 46    .45    .45
  93.    982 22664 22645 247  6  .0089  .0101
  94.   2278 22369 22370 244 24      0    .01
  95.    962 22202 22188 242 21  .0431  .0635
  96.   2262 22214 22280 243 16    .72    .86
  97.   2274 22284 22280 243 15    .18    .21
  98.    555 21285 21274 232 37  .0288  .0326
  99.   2272 22383 22370 244 23  .0351  .0445
  100.   2609 22288 22280 243 37    .22    .29
  101.   2364 22383 22370 244 27   .027   .035
  102.   2080 22203 22188 242 19  .8498  .9712
  103.    952 22384 22370 244 16  .0482  .0603
  104. end
  105. format %tdnn/dd/CCYY PubliDate
  106. format %tdnn/dd/CCYY accper
  107. format %tq q
  108. label values ind1 ind1
  109. label def ind1 2 "B", modify
  110. label def ind1 3 "C13", modify
  111. label def ind1 4 "C14", modify
  112. label def ind1 5 "C15", modify
  113. label def ind1 6 "C17", modify
  114. label def ind1 13 "C24", modify
  115. label def ind1 14 "C25", modify
  116. label def ind1 15 "C26", modify
  117. label def ind1 16 "C27", modify
  118. label def ind1 17 "C28", modify
  119. label def ind1 18 "C29", modify
  120. label def ind1 19 "C30", modify
  121. label def ind1 20 "C31", modify
  122. label def ind1 21 "C32", modify
  123. label def ind1 22 "C33", modify
  124. label def ind1 23 "C34", modify
  125. label def ind1 24 "C35", modify
  126. label def ind1 25 "C36", modify
  127. label def ind1 27 "C38", modify
  128. label def ind1 28 "C39", modify
  129. label def ind1 29 "C40", modify
  130. label def ind1 30 "C41", modify
  131. label def ind1 32 "D", modify
  132. label def ind1 33 "E", modify
  133. label def ind1 34 "F", modify
  134. label def ind1 36 "H", modify
  135. label def ind1 37 "I", modify
  136. label def ind1 39 "K", modify
  137. label def ind1 40 "L", modify
  138. label def ind1 42 "N", modify
  139. label def ind1 44 "P", modify
  140. label def ind1 45 "Q", modify
  141. label def ind1 46 "R", modify
复制代码
------------------ copy up to and including the previous line ------------------



老师,1、我附上了业绩资料,2、我算的是一家公司所属的行业在季度内披露的业绩预告的数量合计(除了这家公司本身)

板凳
黃河泉 在职认证  发表于 2022-11-19 13:04:05
ljt19961998 发表于 2022-11-19 11:13
----------------------- copy starting from the next line ----------------------------------------- ...
请先 ssc install rangestat,我算的是平均数 (你要的请对应改变),试试
  1. rangestat (mean) EPS_Low, interval(StockCode . .) by(q ind1) excludeself
复制代码

报纸
ljt19961998 在职认证  学生认证  发表于 2022-11-19 13:33:47
黃河泉 发表于 2022-11-19 13:04
请先 ssc install rangestat,我算的是平均数 (你要的请对应改变),试试
非常感谢老师,谢谢您

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

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