楼主: luzhiyu4
1941 6

[数据管理求助] 请教一个关于广义倾向得分匹配法的问题!!求教! [推广有奖]

  • 0关注
  • 0粉丝

等待验证会员

本科生

7%

还不是VIP/贵宾

-

威望
0
论坛币
417 个
通用积分
0.0155
学术水平
0 点
热心指数
3 点
信用等级
0 点
经验
670 点
帖子
15
精华
0
在线时间
124 小时
注册时间
2017-3-25
最后登录
2020-11-20

楼主
luzhiyu4 发表于 2020-2-24 09:32:33 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
为何我使用网上的例子中的LotteryDataSet.dta数据,然后使用help里面的示例程序,但是却运行不出来???
最简单的第一步都运行不出来,烦死了,求大佬帮助!!

程序如下:
qui generate cut = 23 if prize<=23
qui replace cut = 80 if prize>23 & prize<=80
qui replace cut = 485 if prize>80
gpscore agew male ownhs owncoll tixbot workthen yearw yearm1 yearm2 yearm3 yearm4 yearm5 yearm6, t(prize) gpscore(pscore) predict(hat_treat) sigma(sd) cutpoints(cut) index(p50) nq_gps(5) t_transf(ln) detail


数据放在下面的链接里,有没有好心人帮我运行下呢?我这个用自己的stata运行出来,一直显示的是invalid syntax  r(198),但是和别人的程序明明是一样的啊
数据:
https://bbs.pinggu.org/a-2604058.html
二维码

扫码加我 拉你入群

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

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


回帖推荐

蓝色 发表于2楼  查看完整内容

没有问题

沙发
蓝色 发表于 2020-2-24 16:40:22
没有问题

  1. . qui generate cut = 23 if prize<=23

  2. . qui replace cut = 80 if prize>23 & prize<=80

  3. . qui replace cut = 485 if prize>80

  4. . gpscore agew male ownhs owncoll tixbot workthen yearw yearm1 yearm2 yearm3 yearm4 yearm5 yearm6, t(prize) gpscore(pscore) predic
  5. > t(hat_treat) sigma(sd) cutpoints(cut) index(p50) nq_gps(5) t_transf(ln) detail

  6. Generalized Propensity Score

  7. ******************************************************
  8. Algorithm to estimate the generalized propensity score
  9. ******************************************************



  10. Estimation of the propensity score

  11. The log transformation of the treatment variable prize is used

  12.                               T
  13. -------------------------------------------------------------
  14.       Percentiles      Smallest
  15. 1%     1.609438       .1301507
  16. 5%     2.283851       .1301507
  17. 10%     2.420012       1.609438       Obs                 237
  18. 25%     2.835211        1.67818       Sum of Wgt.         237

  19. 50%      3.45783                      Mean           3.558185
  20.                         Largest       Std. Dev.      .9553768
  21. 75%     4.143008       5.598792
  22. 90%     4.875426       5.720607       Variance       .9127448
  23. 95%     5.128892       5.778643       Skewness      -.0165889
  24. 99%     5.720607       6.183716       Kurtosis       3.452439

  25. initial:       log likelihood =     -<inf>  (could not be evaluated)
  26. feasible:      log likelihood = -4917.4112
  27. rescale:       log likelihood = -480.91803
  28. rescale eq:    log likelihood = -348.62357
  29. Iteration 0:   log likelihood = -348.62357  
  30. Iteration 1:   log likelihood = -315.79388  
  31. Iteration 2:   log likelihood = -307.71535  
  32. Iteration 3:   log likelihood = -307.68188  
  33. Iteration 4:   log likelihood = -307.68186  

  34.                                                 Number of obs     =        237
  35.                                                 Wald chi2(13)     =      37.22
  36. Log likelihood = -307.68186                     Prob > chi2       =     0.0004

  37. ------------------------------------------------------------------------------
  38.            T |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
  39. -------------+----------------------------------------------------------------
  40. eq1          |
  41.         agew |   .0151905   .0048563     3.13   0.002     .0056724    .0247086
  42.         male |   .4379826   .1351124     3.24   0.001     .1731672     .702798
  43.        ownhs |   .0192025    .060835     0.32   0.752    -.1000319    .1384368
  44.      owncoll |   .0372805   .0397666     0.94   0.349    -.0406607    .1152217
  45.       tixbot |   .0043423   .0182546     0.24   0.812     -.031436    .0401206
  46.     workthen |   .1270879   .1645602     0.77   0.440    -.1954442      .44962
  47.        yearw |  -.0014367   .0464566    -0.03   0.975      -.09249    .0896166
  48.       yearm1 |   .0062064    .010379     0.60   0.550     -.014136    .0265488
  49.       yearm2 |  -.0123161   .0162758    -0.76   0.449     -.044216    .0195839
  50.       yearm3 |   .0119446   .0166256     0.72   0.472    -.0206411    .0445302
  51.       yearm4 |   .0242245   .0158217     1.53   0.126    -.0067855    .0552344
  52.       yearm5 |  -.0216437   .0153635    -1.41   0.159    -.0517555    .0084682
  53.       yearm6 |  -.0050021   .0110455    -0.45   0.651    -.0266509    .0166467
  54.        _cons |   2.315546   .4693959     4.93   0.000     1.395547    3.235545
  55. -------------+----------------------------------------------------------------
  56. eq2          |
  57.        _cons |    .886297    .040709    21.77   0.000      .806509    .9660851
  58. ------------------------------------------------------------------------------

  59. Test for normality of the disturbances

  60. Kolmogorov-Smirnov equality-of-distributions test
  61. Normal Distribution of the disturbances

  62. One-sample Kolmogorov-Smirnov test against theoretical distribution
  63.            normal((res_etreat - r(mean))/sqrt(r(Var)))

  64. Smaller group       D       P-value  Corrected
  65. ----------------------------------------------
  66. res_etreat:         0.0517    0.281
  67. Cumulative:        -0.0420    0.434
  68. Combined K-S:       0.0517    0.550      0.517

  69. The assumption of Normality is statistically satisfied at .05 level

  70.            Estimated generalized propensity score
  71. -------------------------------------------------------------
  72.       Percentiles      Smallest
  73. 1%     .0131817       .0003053
  74. 5%     .0869414       .0011738
  75. 10%     .1272663       .0131817       Obs                 237
  76. 25%     .2255553       .0163113       Sum of Wgt.         237

  77. 50%     .3536221                      Mean           .3196603
  78.                         Largest       Std. Dev.      .1222106
  79. 75%     .4343045       .4500003
  80. 90%     .4481351       .4500911       Variance       .0149354
  81. 95%     .4497166        .450096       Skewness      -.7723501
  82. 99%     .4500911       .4501086       Kurtosis       2.510499

  83. ********************************************
  84. End of the algorithm to estimate the gpscore
  85. ********************************************

  86. ******************************************************************************
  87. The set of the potential treatment values is divided into 3 intervals

  88. The values of the gpscore evaluated at the representative point of each
  89. treatment interval are divided into 5 intervals
  90. ******************************************************************************

  91. ***********************************************************
  92. Summary statistics of the distribution of the GPS evaluated
  93. at the representative point of each treatment interval
  94. ***********************************************************

  95.     Variable |        Obs        Mean    Std. Dev.       Min        Max
  96. -------------+---------------------------------------------------------
  97.        gps_1 |        237     .262852    .0956436   .0583948   .4486237

  98.     Variable |        Obs        Mean    Std. Dev.       Min        Max
  99. -------------+---------------------------------------------------------
  100.        gps_2 |        237    .4178101    .0373217   .2433839   .4501224

  101.     Variable |        Obs        Mean    Std. Dev.       Min        Max
  102. -------------+---------------------------------------------------------
  103.        gps_3 |        237    .1814998     .088236   .0181741   .4141454


  104. ************************************************************************************
  105. Test that the conditional mean of the pre-treatment variables given the generalized
  106. propensity score is not different between units who belong to a particular treatment
  107. interval and units who belong to all other treatment intervals
  108. ************************************************************************************

  109. Treatment Interval No 1 - [1.139000058174133, 22.98200035095215]

  110.                Mean        Standard   
  111.                Difference  Deviation   t-value

  112.         agew  -.25322        1.814    -.13959

  113.         male   .04799       .04246     1.1304

  114.        ownhs   .15044         .156     .96433

  115.      owncoll   .20765       .23738     .87476

  116.       tixbot   .33298       .48448     .68729

  117.     workthen   .00154       .05608      .0275

  118.        yearw   .00156       .19135     .00813

  119.       yearm1   .33117       1.9052     .17382

  120.       yearm2   .90872       1.7719     .51284

  121.       yearm3   1.2445       1.6756     .74274

  122.       yearm4   .74998       1.5625     .47999

  123.       yearm5   .96299       1.7175      .5607

  124.       yearm6   1.4414       1.7774     .81098


  125. Treatment Interval No 2 - [23.08799934387207, 79.11299896240234]

  126.                Mean        Standard   
  127.                Difference  Deviation   t-value

  128.         agew  -.13308       1.8294    -.07275

  129.         male  -.03419        .0657    -.52041

  130.        ownhs   -.2294       .13927    -1.6471

  131.      owncoll  -.20996       .21228    -.98908

  132.       tixbot  -.26933       .43812    -.61474

  133.     workthen   .03013       .05266     .57227

  134.        yearw  -.32817       .17008    -1.9295

  135.       yearm1   .51467       1.7741      .2901

  136.       yearm2   .23703       1.7038     .13912

  137.       yearm3   .41572       1.6656     .24959

  138.       yearm4   .46856        1.571     .29826

  139.       yearm5  -.00903       1.6242    -.00556

  140.       yearm6  -.33587       1.6445    -.20423


  141. Treatment Interval No 3 - [82.98699951171875, 484.7900085449219]

  142.                Mean        Standard   
  143.                Difference  Deviation   t-value

  144.         agew  -1.7504       2.3202    -.75444

  145.         male  -.04742       .06211    -.76342

  146.        ownhs   .34062        .1914     1.7796

  147.      owncoll   .23199       .28116     .82512

  148.       tixbot  -.03159       .56716     -.0557

  149.     workthen  -.07006       .07448    -.94069

  150.        yearw    .3672       .22613     1.6238

  151.       yearm1  -.63678       1.9428    -.32777

  152.       yearm2  -.83409       1.8356    -.45441

  153.       yearm3  -1.2074       1.7322    -.69707

  154.       yearm4   -1.351       1.5982    -.84534

  155.       yearm5  -1.6137       1.8792     -.8587

  156.       yearm6  -2.2111       1.8615    -1.1878


  157. According to a standard two-sided t test:

  158. Moderate evidence against the balancing property

  159. The balancing property is satisfied at level 0.05
复制代码

藤椅
luzhiyu4 发表于 2020-2-25 09:34:54
蓝色 发表于 2020-2-24 16:40
没有问题
谢谢,那看来是我的stata有问题吗?每次出来都提示说invalid syntax

板凳
蓝色 发表于 2020-2-25 09:58:24
命令没有问题,那就是你的stata的问题
重新安装、升级软件

报纸
luzhiyu4 发表于 2020-2-25 10:24:57
蓝色 发表于 2020-2-25 09:58
命令没有问题,那就是你的stata的问题
重新安装、升级软件
好的,谢谢了!

地板
湘江之水 发表于 2020-8-20 14:48:21

7
yelell 发表于 2023-3-29 15:03:29
您好,请问下方便分享一下lotterydataset的数据吗

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

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