楼主: 瘐徒
7816 29

[学习心得] dataex命令练习 [推广有奖]

11
江东桥 发表于 2019-11-20 11:20:50
江东桥 发表于 2019-11-20 11:20
  1. wrqwe
复制代码

12
yuzhaopeng 发表于 2019-11-21 11:41:43
学习了

13
ssfder 发表于 2019-12-15 12:53:21
  1. * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input str18 make int(rep78 price) byte foreign
  4. "AMC Concord"       3  4099 0
  5. "AMC Pacer"         3  4749 0
  6. "AMC Spirit"        .  3799 0
  7. "Buick Century"     3  4816 0
  8. "Buick Electra"     4  7827 0
  9. "Buick LeSabre"     3  5788 0
  10. "Buick Opel"        .  4453 0
  11. "Buick Regal"       3  5189 0
  12. "Buick Riviera"     3 10372 0
  13. "Buick Skylark"     3  4082 0
  14. "Cad. Deville"      3 11385 0
  15. "Cad. Eldorado"     2 14500 0
  16. "Cad. Seville"      3 15906 0
  17. "Chev. Chevette"    3  3299 0
  18. "Chev. Impala"      4  5705 0
  19. "Chev. Malibu"      3  4504 0
  20. "Chev. Monte Carlo" 2  5104 0
  21. "Chev. Monza"       2  3667 0
  22. "Chev. Nova"        3  3955 0
  23. "Dodge Colt"        5  3984 0
  24. "Dodge Diplomat"    2  4010 0
  25. "Dodge Magnum"      2  5886 0
  26. "Dodge St. Regis"   2  6342 0
  27. "Ford Fiesta"       4  4389 0
  28. "Ford Mustang"      3  4187 0
  29. "Linc. Continental" 3 11497 0
  30. "Linc. Mark V"      3 13594 0
  31. "Linc. Versailles"  3 13466 0
  32. "Merc. Bobcat"      4  3829 0
  33. "Merc. Cougar"      4  5379 0
  34. end
  35. label values foreign origin
  36. label def origin 0 "Domestic", modify
复制代码

14
千反田折木 发表于 2020-2-2 01:40:59
  1. * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input float event_date long company_id float date double(ret market_return) float num
  4. 18961 600388 18830 -.008699  .002346 1
  5. 18961 600388 18984 -.004367  .009342 1
  6. 18961 600388 18809 -.006953  .000011 1
  7. 18961 600388 18682 -.007279  .005457 1
  8. 18961 600388 18506  .038027 -.006091 1
  9. 18961 600388 18676  .048442  -.00894 1
  10. 18961 600388 18624 -.033353 -.016965 1
  11. 18961 600388 18980  .031383 -.003038 1
  12. 18961 600388 18336  .017257 -.011712 1
  13. 18961 600388 18266 -.017764 -.009115 1
  14. 18961 600388 18912  .034029  .031214 1
  15. 18961 600388 18732  .011307  .003103 1
  16. 18961 600388 18820 -.016577 -.017397 1
  17. 18961 600388 18568  .009864 -.004014 1
  18. 18961 600388 18303  .000602  .011957 1
  19. 18961 600388 18988 -.047127 -.010898 1
  20. 18961 600388 18450  .014196  .005354 1
  21. 18961 600388 18696 -.022195 -.015737 1
  22. 18961 600388 18899 -.022491 -.010622 1
  23. 18961 600388 18781  .014079  .008528 1
  24. 18961 600388 18815 -.001804  -.00599 1
  25. 18961 600388 18952 -.022831 -.000482 1
  26. 18961 600388 18837 -.013425 -.002716 1
  27. 18961 600388 18588  .028732 -.002064 1
  28. 18961 600388 18956  .002103  -.00702 1
  29. 18961 600388 18725  .010537  .007684 1
  30. 18961 600388 18637 -.039256 -.017141 1
  31. 18961 600388 18934 -.014747  .001938 1
  32. 18961 600388 18889 -.020358 -.017301 1
  33. 18961 600388 18640  .002118  .003117 1
  34. 18961 600388 18857 -.015528 -.016201 1
  35. 18961 600388 18690  .017273  .014294 1
  36. 18961 600388 18294 -.024171  -.01471 1
  37. 18961 600388 18458 -.031563  -.02009 1
  38. 18961 600388 18507   .00264  .014258 1
  39. 18961 600388 18281 -.018097  .001462 1
  40. 18961 600388 18801   .01792  .015229 1
  41. 18961 600388 18613 -.002167 -.002573 1
  42. 18961 600388 18669 -.002462  .003102 1
  43. 18961 600388 18910 -.025551 -.005847 1
  44. 18961 600388 18505 -.012183  -.00504 1
  45. 18961 600388 18584 -.003427  .011106 1
  46. 18961 600388 18358 -.017867 -.000592 1
  47. 18961 600388 18448 -.020907  -.00752 1
  48. 18961 600388 18856 -.003867 -.002719 1
  49. 18961 600388 18766   .00683 -.004203 1
  50. 18961 600388 18760  .011099  .010011 1
  51. 18961 600388 18700  .005949  .001594 1
  52. 18961 600388 18367 -.099309 -.002848 1
  53. 18961 600388 18424 -.002558  .002353 1
  54. 18961 600388 18449  .021757  .021919 1
  55. 18961 600388 18913  .013164  .008147 1
  56. 18961 600388 18717 -.022842 -.009904 1
  57. 18961 600388 18927  .048869  .003451 1
  58. 18961 600388 18750  .012359  .007404 1
  59. 18961 600388 18687  .003273  .005417 1
  60. 18961 600388 18975 -.043952 -.008288 1
  61. 18961 600388 18372  .027123  .000096 1
  62. 18961 600388 18340 -.002066  .007407 1
  63. 18961 600388 18816 -.012288  .001082 1
  64. 18961 600388 18799  .015336  .009962 1
  65. 18961 600388 18550  .012978  .032908 1
  66. 18961 600388 18785  .014634  .006753 1
  67. 18961 600388 18604 -.037808  -.01009 1
  68. 18961 600388 18638  .007567  .005345 1
  69. 18961 600388 18935  .007686  .008401 1
  70. 18961 600388 18526 -.038822  .001832 1
  71. 18961 600388 18686  .023447  .009233 1
  72. 18961 600388 18499 -.041977 -.021955 1
  73. 18961 600388 18945  .053474  .019898 1
  74. 18961 600388 18543  .020188  .029915 1
  75. 18961 600388 18366  .022775  .002537 1
  76. 18961 600388 18812  .030008   .02018 1
  77. 18961 600388 18438  .014356 -.005005 1
  78. 18961 600388 18940  .008976   .00839 1
  79. 18961 600388 18599  .004197    .0001 1
  80. 18961 600388 18840   .00662  .000599 1
  81. 18961 600388 18854  .018831  .013425 1
  82. 18961 600388 18753  .008246 -.003676 1
  83. 18961 600388 18886 -.013258  .001587 1
  84. 18961 600388 18681  .012903  .001709 1
  85. 18961 600388 18742 -.029815  -.01543 1
  86. 18961 600388 18393 -.020291 -.020688 1
  87. 18961 600388 18731 -.014098 -.003418 1
  88. 18961 600388 18674  .008445  .008333 1
  89. 18961 600388 18653  .025899  .011285 1
  90. 18961 600388 18330 -.005052  .006311 1
  91. 18961 600388 18414 -.036077 -.010214 1
  92. 18961 600388 18296  .011874  .023136 1
  93. 18961 600388 18844 -.018587 -.021982 1
  94. 18961 600388 18276  .044737  .014998 1
  95. 18961 600388 18407 -.004984 -.018998 1
  96. 18961 600388 18295  -.01048 -.002405 1
  97. 18961 600388 18484 -.050251 -.030198 1
  98. 18961 600388 18814  .001083  -.00149 1
  99. 18961 600388 18751 -.031239 -.023124 1
  100. 18961 600388 18546  .003628  .023349 1
  101. 18961 600388 18981  -.03456  -.00084 1
  102. 18961 600388 18395   .02798  .022694 1
  103. 18961 600388 18675  .005273  .000468 1
  104. end
  105. format %td event_date
  106. format %td date
复制代码

15
0075336306 发表于 2020-2-26 19:48:02
  1. * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input float id str18 make int(price mpg rep78) float headroom int(turn trunk)
  4. 1 "AMC Concord"        4099 22 3 2.5 40 11
  5. 2 "AMC Pacer"          4749 17 3   3 40 11
  6. 3 "AMC Spirit"         3799 22 .   3 35 12
  7. 4 "Buick Century"      4816 20 3 4.5 40 16
  8. 5 "Buick Electra"      7827 15 4   4 43 20
  9. 6 "Buick LeSabre"      5788 18 3   4 43 21
  10. 7 "Buick Opel"         4453 26 .   3 34 10
  11. 8 "Buick Regal"        5189 20 3   2 42 16
  12. 9 "Buick Riviera"     10372 16 3 3.5 43 17
  13. 10 "Buick Skylark"      4082 19 3 3.5 42 13
  14. 11 "Cad. Deville"      11385 14 3   4 44 20
  15. 12 "Cad. Eldorado"     14500 14 2 3.5 43 16
  16. 13 "Cad. Seville"      15906 21 3   3 45 13
  17. 14 "Chev. Chevette"     3299 29 3 2.5 34  9
  18. 15 "Chev. Impala"       5705 16 4   4 43 20
  19. 16 "Chev. Malibu"       4504 22 3 3.5 31 17
  20. 17 "Chev. Monte Carlo"  5104 22 2   2 41 16
  21. 18 "Chev. Monza"        3667 24 2   2 40  7
  22. 19 "Chev. Nova"         3955 19 3 3.5 43 13
  23. 20 "Dodge Colt"         3984 30 5   2 35  8
  24. 21 "Dodge Diplomat"     4010 18 2   4 46 17
  25. 22 "Dodge Magnum"       5886 16 2   4 46 17
  26. 23 "Dodge St. Regis"    6342 17 2 4.5 46 21
  27. 24 "Ford Fiesta"        4389 28 4 1.5 33  9
  28. 25 "Ford Mustang"       4187 21 3   2 43 10
  29. 26 "Linc. Continental" 11497 12 3 3.5 51 22
  30. 27 "Linc. Mark V"      13594 12 3 2.5 48 18
  31. 28 "Linc. Versailles"  13466 14 3 3.5 41 15
  32. 29 "Merc. Bobcat"       3829 22 4   3 39  9
  33. 30 "Merc. Cougar"       5379 14 4 3.5 48 16
  34. 31 "Merc. Marquis"      6165 15 3 3.5 44 23
  35. 32 "Merc. Monarch"      4516 18 3   3 41 15
  36. 33 "Merc. XR-7"         6303 14 4   3 45 16
  37. 34 "Merc. Zephyr"       3291 20 3 3.5 43 17
  38. 35 "Olds 98"            8814 21 4   4 43 20
  39. 36 "Olds Cutl Supr"     5172 19 3   2 42 16
  40. 37 "Olds Cutlass"       4733 19 3 4.5 42 16
  41. 38 "Olds Delta 88"      4890 18 4   4 42 20
  42. 39 "Olds Omega"         4181 19 3 4.5 43 14
  43. 40 "Olds Starfire"      4195 24 1   2 40 10
  44. 41 "Olds Toronado"     10371 16 3 3.5 43 17
  45. 42 "Plym. Arrow"        4647 28 3   2 37 11
  46. 43 "Plym. Champ"        4425 34 5 2.5 37 11
  47. 44 "Plym. Horizon"      4482 25 3   4 36 17
  48. 45 "Plym. Sapporo"      6486 26 . 1.5 38  8
  49. 46 "Plym. Volare"       4060 18 2   5 44 16
  50. 47 "Pont. Catalina"     5798 18 4   4 42 20
  51. 48 "Pont. Firebird"     4934 18 1 1.5 42  7
  52. 49 "Pont. Grand Prix"   5222 19 3   2 45 16
  53. 50 "Pont. Le Mans"      4723 19 3 3.5 40 17
  54. 51 "Pont. Phoenix"      4424 19 . 3.5 43 13
  55. 52 "Pont. Sunbird"      4172 24 2   2 41  7
  56. 53 "Audi 5000"          9690 17 5   3 37 15
  57. 54 "Audi Fox"           6295 23 3 2.5 36 11
  58. 55 "BMW 320i"           9735 25 4 2.5 34 12
  59. 56 "Datsun 200"         6229 23 4 1.5 35  6
  60. 57 "Datsun 210"         4589 35 5   2 32  8
  61. 58 "Datsun 510"         5079 24 4 2.5 34  8
  62. 59 "Datsun 810"         8129 21 4 2.5 38  8
  63. 60 "Fiat Strada"        4296 21 3 2.5 36 16
  64. 61 "Honda Accord"       5799 25 5   3 36 10
  65. 62 "Honda Civic"        4499 28 4 2.5 34  5
  66. 63 "Mazda GLC"          3995 30 4 3.5 33 11
  67. 64 "Peugeot 604"       12990 14 . 3.5 38 14
  68. 65 "Renault Le Car"     3895 26 3   3 34 10
  69. 66 "Subaru"             3798 35 5 2.5 36 11
  70. 67 "Toyota Celica"      5899 18 5 2.5 36 14
  71. 68 "Toyota Corolla"     3748 31 5   3 35  9
  72. 69 "Toyota Corona"      5719 18 5   2 36 11
  73. 70 "VW Dasher"          7140 23 4 2.5 36 12
  74. 71 "VW Diesel"          5397 41 5   3 35 15
  75. 72 "VW Rabbit"          4697 25 4   3 35 15
  76. 73 "VW Scirocco"        6850 25 4   2 36 16
  77. 74 "Volvo 260"         11995 17 5 2.5 37 14
  78. end
复制代码

16
jianweiai@RUC 发表于 2020-5-13 18:58:22
  1. * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input str18 make int(price mpg rep78)
  4. "AMC Concord"   4099 22 3
  5. "AMC Pacer"     4749 17 3
  6. "AMC Spirit"    3799 22 .
  7. "Buick Century" 4816 20 3
  8. "Buick Electra" 7827 15 4
  9. end
复制代码

17
WARM-KILLER 发表于 2020-8-16 20:45:12
  1. * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input float id int(price mpg rep78) float headroom int trunk
  4. 1  4099 22 3 2.5 11
  5. 2  4749 17 3   3 11
  6. 3  3799 22 .   3 12
  7. 4  4816 20 3 4.5 16
  8. 5  7827 15 4   4 20
  9. 6  5788 18 3   4 21
  10. 7  4453 26 .   3 10
  11. 8  5189 20 3   2 16
  12. 9 10372 16 3 3.5 17
  13. 10  4082 19 3 3.5 13
  14. 11 11385 14 3   4 20
  15. 12 14500 14 2 3.5 16
  16. 13 15906 21 3   3 13
  17. 14  3299 29 3 2.5  9
  18. 15  5705 16 4   4 20
  19. 16  4504 22 3 3.5 17
  20. 17  5104 22 2   2 16
  21. 18  3667 24 2   2  7
  22. 19  3955 19 3 3.5 13
  23. 20  3984 30 5   2  8
  24. end[size=14px]
复制代码

18
虾滑真好吃 发表于 2020-8-17 09:53:12
  1. * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input str10(sku_id user_id) double(clickdate orderdate) float direct_discount_per_unit
  4. "000aa92b82" "38e2778fca" 21251     . .
  5. "000aa92b82" "f3fadcbf5c" 21262     . .
  6. "000aa92b82" "d115fb16a8" 21251     . .
  7. "000aa92b82" "76b2ea185b" 21246     . .
  8. "000aa92b82" "d813e0597d" 21256     . .
  9. "000aa92b82" "6278448747" 21268     . .
  10. "000aa92b82" "8265688778" 21266     . .
  11. "000aa92b82" "69e288c303" 21267     . .
  12. "000aa92b82" "46eb74be41" 21268     . .
  13. "000aa92b82" "966ff515f3" 21250     . .
  14. "000aa92b82" "2151bc8748" 21255     . .
  15. "000aa92b82" "d7ec9b1039" 21259     . .
  16. "000aa92b82" "c28fab45ac" 21257     . .
  17. "000aa92b82" "a85d09e13e" 21247     . .
  18. "000aa92b82" "c5defb3733" 21256     . .
  19. "000aa92b82" "84ecb4ec6f" 21246 21246 0
  20. "000aa92b82" "1836f391b3" 21272     . .
  21. "000aa92b82" "797d0864f1" 21267     . .
  22. "000aa92b82" "f0f86166d7" 21265     . .
  23. "000aa92b82" "95e1b2cbf1" 21261     . .
  24. end
  25. format %td clickdate
  26. format %td orderdate
复制代码

19
Shane323 在职认证  学生认证  发表于 2020-9-6 09:57:10
  1.             * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input str40 Location
  4. "Guandong (province), Shenzhen (city)"
  5. "Beijing (province)"            
  6. "Shanghai (province)"
  7. "Hubei (province)"
  8. "Henan"
  9. end

  10. gen First=0
  11. replace First=1 if regexm(Location,"Guandong")
  12. replace First=1 if regexm(Location,"Shanghai")
  13. replace First=1 if regexm(Location,"Beijing")
  14.          
  15.          
复制代码

20
四十九日雨 在职认证  学生认证  发表于 2020-11-5 09:41:32
  1. * Example generated by -dataex-. To install: ssc install dataex
  2. clear
  3. input byte(mage cigs) float(totcigs dailycigs m_feduc) byte(feduc npvis)
  4. 26  0 1876 12.761905 13.915406 16 12
  5. 29  . 1876 12.761905 13.915406 12 12
  6. 33  0 1876 12.761905 13.915406 16 12
  7. 28  0 1876 12.761905 13.915406 17  8
  8. 23  0 1876 12.761905 13.915406 16  6
  9. 28  0 1876 12.761905 13.915406 16 12
  10. 27  0 1876 12.761905 13.915406 16 11
  11. 41  0 1876 12.761905 13.915406  .  8
  12. 32  0 1876 12.761905 13.915406 16 11
  13. 16  0 1876 12.761905 13.915406 10 10
  14. 26  0 1876 12.761905 13.915406 14 12
  15. 25  0 1876 12.761905 13.915406 12 13
  16. 28  0 1876 12.761905 13.915406 16 14
  17. 29  0 1876 12.761905 13.915406 12  8
  18. 31  0 1876 12.761905 13.915406 16  9
  19. 29  0 1876 12.761905 13.915406 12 12
  20. 26  0 1876 12.761905 13.915406 16 13
  21. 31  0 1876 12.761905 13.915406 17 12
  22. 28  . 1876 12.761905 13.915406 16 12
  23. 27  0 1876 12.761905 13.915406 12 12
  24. 30  0 1876 12.761905 13.915406 12 17
  25. 24  0 1876 12.761905 13.915406 11  8
  26. 22  0 1876 12.761905 13.915406 16 12
  27. 19  0 1876 12.761905 13.915406 12  7
  28. 27  0 1876 12.761905 13.915406 12 14
  29. 32  0 1876 12.761905 13.915406 14 15
  30. 30  0 1876 12.761905 13.915406 13 12
  31. 36  0 1876 12.761905 13.915406 16 11
  32. 27  0 1876 12.761905 13.915406 16 12
  33. 29  0 1876 12.761905 13.915406 11 12
  34. 26  0 1876 12.761905 13.915406 14 12
  35. 28  0 1876 12.761905 13.915406 12  8
  36. 28  0 1876 12.761905 13.915406 12 15
  37. 23  0 1876 12.761905 13.915406 16 10
  38. 32  0 1876 12.761905 13.915406 16 12
  39. 24 10 1876 12.761905 13.915406 13  7
  40. 27  0 1876 12.761905 13.915406 12 15
  41. 28  0 1876 12.761905 13.915406 13 12
  42. 32  0 1876 12.761905 13.915406 12  6
  43. 35  0 1876 12.761905 13.915406 12 14
  44. 25  0 1876 12.761905 13.915406 17 16
  45. 29  0 1876 12.761905 13.915406 16 14
  46. 24  0 1876 12.761905 13.915406 12 30
  47. 26  0 1876 12.761905 13.915406 17 10
  48. 29  0 1876 12.761905 13.915406 12 10
  49. 38  0 1876 12.761905 13.915406 16 12
  50. 30  0 1876 12.761905 13.915406 12  9
  51. 37  0 1876 12.761905 13.915406 14  8
  52. 24  0 1876 12.761905 13.915406 12 11
  53. 24  0 1876 12.761905 13.915406 16 10
  54. 28  0 1876 12.761905 13.915406 12 11
  55. 29  0 1876 12.761905 13.915406 12 30
  56. 27  . 1876 12.761905 13.915406 16 12
  57. 30  0 1876 12.761905 13.915406 16 12
  58. 27  0 1876 12.761905 13.915406 12 10
  59. 36  0 1876 12.761905 13.915406 16 12
  60. 25  0 1876 12.761905 13.915406 12  8
  61. 30  0 1876 12.761905 13.915406 16 12
  62. 29  0 1876 12.761905 13.915406 17 10
  63. 28  0 1876 12.761905 13.915406 16 12
  64. 33 10 1876 12.761905 13.915406 12 15
  65. 32  0 1876 12.761905 13.915406 16 11
  66. 31  0 1876 12.761905 13.915406  .  9
  67. 33  0 1876 12.761905 13.915406 16 13
  68. 16  0 1876 12.761905 13.915406 11 12
  69. 34  0 1876 12.761905 13.915406 16 14
  70. 33  0 1876 12.761905 13.915406 16 12
  71. 25  0 1876 12.761905 13.915406 16  5
  72. 31  . 1876 12.761905 13.915406 16 12
  73. 31  0 1876 12.761905 13.915406 14 13
  74. 30  0 1876 12.761905 13.915406 14 11
  75. 21  0 1876 12.761905 13.915406 12 14
  76. 31  0 1876 12.761905 13.915406 16  .
  77. 34  3 1876 12.761905 13.915406 12 12
  78. 23  0 1876 12.761905 13.915406 12 15
  79. 23  0 1876 12.761905 13.915406 12 12
  80. 24 10 1876 12.761905 13.915406 12 18
  81. 30  0 1876 12.761905 13.915406 12  9
  82. 38  0 1876 12.761905 13.915406 16 15
  83. 30  0 1876 12.761905 13.915406 17 11
  84. 34  4 1876 12.761905 13.915406 14 12
  85. 30  0 1876 12.761905 13.915406 16 12
  86. 33  0 1876 12.761905 13.915406 16 12
  87. 37 20 1876 12.761905 13.915406 12 12
  88. 25  0 1876 12.761905 13.915406 12  .
  89. 24  0 1876 12.761905 13.915406 12 14
  90. 27  0 1876 12.761905 13.915406 14 15
  91. 26  0 1876 12.761905 13.915406  .  2
  92. 20  0 1876 12.761905 13.915406 16  8
  93. 28  0 1876 12.761905 13.915406 17  7
  94. 31  0 1876 12.761905 13.915406 13 15
  95. 32  0 1876 12.761905 13.915406 17  5
  96. 31  0 1876 12.761905 13.915406 16 16
  97. 25  0 1876 12.761905 13.915406  9 11
  98. 29  0 1876 12.761905 13.915406 12  .
  99. 26  0 1876 12.761905 13.915406 12 10
  100. 20  0 1876 12.761905 13.915406 16 10
  101. 22  0 1876 12.761905 13.915406 12 11
  102. 28  0 1876 12.761905 13.915406 16 11
  103. 18  4 1876 12.761905 13.915406 12 16
  104. end
复制代码

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

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