楼主: 黃河泉
218206 653

[程序分享] 【面板门槛回归】之 Stata 程序   [推广有奖]

171
lane24700 发表于 2017-9-13 16:03:16
黄老师,还有个问题想请教您,经常遇到存在三重门槛是显著的,但是实际上三重门槛的模型中总是有一个区间是由于共线性被去掉(如图,其中系数为0的一行即为被自动删去的区间),那么这种时候可以只使用双重门槛模型吗? 三重阈值.png

172
黃河泉 在职认证  发表于 2017-9-13 16:24:53
lane24700 发表于 2017-9-13 15:54
谢谢黄老师,我之前在连玉君老师的命令中直接加入i.year希望能控制时间效应,不过命令不支持,之后再试试 ...
我刚刚试过,是可以的!请先产生时间虚拟变量:
  1. tab year, gen(dy)
复制代码
接著试试
  1. xthreg i q1 q2 q3 d1 qd1 dy*, rx(c1) qx(d1) thnum(1) grid(400) trim(0.05) bs(100) vce(robust)
复制代码

173
黃河泉 在职认证  发表于 2017-9-13 16:26:03
  1. xthreg i q1 q2 q3 d1 qd1 dy*, rx(c1) qx(d1) thnum(1) grid(400) trim(0.05) bs(100) vce(robust)
  2. Estimating  the  threshold  parameters:   1st ......  Done
  3. Boostrap for single threshold
  4. .................................................. +   50
  5. .................................................. +  100

  6. Threshold estimator (level = 95):
  7. -----------------------------------------------------
  8.      model |    Threshold         Lower         Upper
  9. -----------+-----------------------------------------
  10.       Th-1 |       0.0158        0.0141        0.0169
  11. -----------------------------------------------------

  12. Threshold effect test (bootstrap = 100):
  13. -------------------------------------------------------------------------------
  14. Threshold |       RSS        MSE      Fstat    Prob   Crit10    Crit5    Crit1
  15. -----------+-------------------------------------------------------------------
  16.     Single |   17.4771     0.0022      26.90  0.0000  11.4726  12.9234  13.4508
  17. -------------------------------------------------------------------------------
  18. note: dy14 omitted because of collinearity

  19. Fixed-effects (within) regression               Number of obs      =      7910
  20. Group variable: id                              Number of groups   =       565

  21. R-sq:  within  = 0.1106                         Obs per group: min =        14
  22.        between = 0.0661                                        avg =      14.0
  23.        overall = 0.0729                                        max =        14

  24.                                                 F(20,564)          =     25.73
  25. corr(u_i, Xb)  = -0.3789                        Prob > F           =    0.0000

  26.                                    (Std. Err. adjusted for 565 clusters in id)
  27. ------------------------------------------------------------------------------
  28.              |               Robust
  29.            i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
  30. -------------+----------------------------------------------------------------
  31.           q1 |     .00992   .0020279     4.89   0.000     .0059369    .0139031
  32.           q2 |  -.0189584   .0055799    -3.40   0.001    -.0299183   -.0079985
  33.           q3 |   .0010024   .0003503     2.86   0.004     .0003144    .0016904
  34.           d1 |   -.023176   .0056735    -4.08   0.000    -.0343198   -.0120322
  35.          qd1 |   .0006228   .0022203     0.28   0.779    -.0037382    .0049839
  36.          dy1 |   .0010962   .0029653     0.37   0.712    -.0047282    .0069205
  37.          dy2 |  -.0067276   .0029638    -2.27   0.024     -.012549   -.0009062
  38.          dy3 |  -.0068704   .0030347    -2.26   0.024    -.0128312   -.0009096
  39.          dy4 |  -.0039999   .0030213    -1.32   0.186    -.0099343    .0019345
  40.          dy5 |   .0022225   .0030576     0.73   0.468    -.0037832    .0082281
  41.          dy6 |   .0039242     .00305     1.29   0.199    -.0020666     .009915
  42.          dy7 |   .0074663   .0033057     2.26   0.024     .0009732    .0139594
  43.          dy8 |    .003355   .0029832     1.12   0.261    -.0025045    .0092145
  44.          dy9 |  -.0060543   .0028575    -2.12   0.035    -.0116669   -.0004416
  45.         dy10 |  -.0111208   .0025575    -4.35   0.000    -.0161441   -.0060974
  46.         dy11 |   .0050081   .0026878     1.86   0.063    -.0002713    .0102875
  47.         dy12 |   .0115208   .0040236     2.86   0.004     .0036177    .0194239
  48.         dy13 |   .0063149   .0025458     2.48   0.013     .0013145    .0113152
  49.         dy14 |          0  (omitted)
  50.              |
  51.    _cat#c.c1 |
  52.           0  |   .0557229    .008953     6.22   0.000     .0381375    .0733082
  53.           1  |   .0825998   .0120212     6.87   0.000      .058988    .1062116
  54.              |
  55.        _cons |   .0638135   .0038674    16.50   0.000     .0562172    .0714098
  56. -------------+----------------------------------------------------------------
  57.      sigma_u |  .03965029
  58.      sigma_e |  .04884623
  59.          rho |  .39719703   (fraction of variance due to u_i)
  60. ------------------------------------------------------------------------------
复制代码

174
lane24700 发表于 2017-9-13 16:31:40
黃河泉 发表于 2017-9-13 16:24
我刚刚试过,是可以的!请先产生时间虚拟变量:接著试试
先产生时间变量的方法可以!谢谢老师!

175
小丫头花海 发表于 2017-9-15 10:26:50
请问xthreg有关三个门槛的LR图程序是什么呢?特别着急啊,请大神不吝赐教跪谢!

176
黃河泉 在职认证  发表于 2017-9-15 10:29:48
小丫头花海 发表于 2017-9-15 10:26
请问xthreg有关三个门槛的LR图程序是什么呢?特别着急啊,请大神不吝赐教跪谢!
没画过,也不重要!

177
小丫头花海 发表于 2017-9-15 10:34:13
黃河泉 发表于 2017-9-15 10:29
没画过,也不重要!
我看好多论文在存在三重门槛的时候,附带了三个LR图,xthreg只提供了双重门槛LR图的程序,我再琢磨一下吧,谢谢您

178
黃河泉 在职认证  发表于 2017-9-15 15:27:58
小丫头花海 发表于 2017-9-15 10:34
我看好多论文在存在三重门槛的时候,附带了三个LR图,xthreg只提供了双重门槛LR图的程序,我再琢磨一下吧 ...
"可能类似"
  1. xthreg i q1 q2 q3 qd1 d1, rx(c1) qx(d1) thnum(3) grid(100) trim(0.05 0.05 0.05) bs(100 100 100)
  2. * plot the LR statistic vs threshold
  3. _matplot e(LR21), columns(1 2) yline(7.35, lpattern(dash)) ///
  4.         connect(direct) msize(small) mlabp(0) mlabs(zero) ///
  5.         ytitle("LR Statistics") xtitle("First Threshold") recast(line) name(LR21) nodraw
  6. _matplot e(LR22), columns(1 2) yline(7.35, lpattern(dash)) ///
  7.         connect(direct) msize(small) mlabp(0) mlabs(zero) ///
  8.         ytitle("LR Statistics") xtitle("Second Threshold") recast(line) name(LR22) nodraw
  9. _matplot e(LR3), columns(1 2) yline(7.35, lpattern(dash)) ///
  10.         connect(direct) msize(small) mlabp(0) mlabs(zero) ///
  11.         ytitle("LR Statistics") xtitle("Third Threshold") recast(line) name(LR3) nodraw       
  12. graph combine LR21 LR22 LR3, cols(3)
复制代码
请再琢磨一下!

179
酪氨酸酶6 发表于 2017-9-18 14:46:55
老师您好 请问绘制LR图的程序是什么呢

180
黃河泉 在职认证  发表于 2017-9-18 14:57:35
酪氨酸酶6 发表于 2017-9-18 14:46
老师您好 请问绘制LR图的程序是什么呢
什么意思?上面不就是吗?

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-10 01:06