楼主: ______沉、默
1053 2

[数据管理求助] 在行业--年度内将指标标准化 [推广有奖]

  • 2关注
  • 1粉丝

已卖:4份资源

副教授

60%

还不是VIP/贵宾

-

威望
0
论坛币
189 个
通用积分
27.3653
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
41692 点
帖子
208
精华
0
在线时间
1472 小时
注册时间
2011-9-13
最后登录
2025-12-15

楼主
______沉、默 发表于 2019-7-10 14:20:00 |AI写论文
30论坛币
  1. * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input long Stkcd int year str1 industry long industry1 double
  4. 2 2007 "K" 11   .03362391340529485
  5. 4 2007 "C"  3    .0841709790247756
  6. 5 2007 "N" 14   .06680823177520316
  7. 6 2007 "K" 11   .02406960205708494
  8. 7 2007 "K" 11   .34584747725017684
  9. 8 2007 "C"  3                    0
  10. 9 2007 "S" 19   .10536935885413262
  11. 10 2007 "E"  5   .13230295175614434
  12. 11 2007 "K" 11     .047820329098901
  13. 12 2007 "C"  3  .059999768698986586
  14. 14 2007 "K" 11    .0468995562156754
  15. 16 2007 "C"  3   .13086054936594432
  16. 17 2007 "C"  3  .023624086663158666
  17. 18 2007 "E"  5   .08310366670514358
  18. 19 2007 "F"  6   .05172192876485973
  19. 20 2007 "C"  3  .019321206983256477
  20. 21 2007 "C"  3 .0006759236454370307
  21. 22 2007 "G"  7                    0
  22. 23 2007 "C"  3   .00755740411257228
  23. 24 2007 "K" 11  .018536320901745784
  24. 25 2007 "F"  6  .040621293910869875
  25. 26 2007 "F"  6   .13156575130379813
  26. 27 2007 "D"  4 .0032539791264399463
  27. 28 2007 "F"  6   .04819892984019948
  28. 29 2007 "K" 11  .012028458879834754
  29. 30 2007 "C"  3                    0
  30. 31 2007 "K" 11  .031310608738715884
  31. 32 2007 "F"  6   .02536506465665209
  32. 33 2007 "H"  8   .03951690424780539
  33. 34 2007 "F"  6  .026083300078110733
  34. 35 2007 "N" 14                    0
  35. 36 2007 "K" 11  .010901860918732152
  36. 37 2007 "D"  4 .0005980458127953628
  37. 38 2007 "L" 12                    0
  38. 39 2007 "C"  3  .023642872661755156
  39. 40 2007 "D"  4   .03915886837104796
  40. 42 2007 "K" 11   .03834453939134502
  41. 43 2007 "K" 11   .06659539900249045
  42. 45 2007 "C"  3  .035226745825436015
  43. 46 2007 "K" 11  .020749842605497074
  44. 49 2007 "C"  3   .03547853320400405
  45. 50 2007 "C"  3  .027873882100094997
  46. 55 2007 "C"  3   .03299784122945226
  47. 56 2007 "K" 11    .5001182722775588
  48. 58 2007 "L" 12   .05147559957840853
  49. 59 2007 "C"  3   .00793354229260099
  50. 60 2007 "C"  3  .010121890754176303
  51. 61 2007 "L" 12   .09508908693031878
  52. 62 2007 "F"  6   .09999352598703298
  53. 63 2007 "C"  3   .12637956480716478
  54. end
  55. label values industry1 industry1
  56. label def industry1 3 "C", modify
  57. label def industry1 4 "D", modify
  58. label def industry1 5 "E", modify
  59. label def industry1 6 "F", modify
  60. label def industry1 7 "G", modify
  61. label def industry1 8 "H", modify
  62. label def industry1 11 "K", modify
  63. label def industry1 12 "L", modify
  64. label def industry1 14 "N", modify
  65. label def industry1 19 "S", modify
复制代码



谢谢各位!

最佳答案

关键词:标准化 generated Industry generate install

沙发
黃河泉 在职认证  发表于 2019-7-10 14:20:01
试试
  1. bys year industry: egen m = mean(s1)
  2. bys year industry: egen sd = sd(s1)
  3. gen wanted = abs((s1-m)/sd)
复制代码

藤椅
______沉、默 发表于 2019-7-10 15:46:43
黃河泉 发表于 2019-7-10 14:20
试试
谢谢黄老师

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

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