楼主: 黃河泉
218134 653

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

121
NanFangshuju 发表于 2016-12-31 10:51:59
这个给力 正需要呢

122
campbell0912 发表于 2016-12-31 13:11:06 来自手机
谢谢老师!

123
mufangzhu 发表于 2017-1-5 18:08:23
老师我的LR图是这个样子的,请问您知道如何去掉上面的字么?谢谢老师

15.PNG (20.88 KB)

15.PNG

124
黃河泉 在职认证  发表于 2017-1-6 07:40:55
mufangzhu 发表于 2017-1-5 18:08
老师我的LR图是这个样子的,请问您知道如何去掉上面的字么?谢谢老师
你指的是那些 rxx 吗?奇怪,你怎么会有这些东西呢(我从没看过,而且图很怪)?可否将你用的指令 show 出来一下!

125
mufangzhu 发表于 2017-1-6 09:35:46

xthreg lninno lnofdi lnfdi lnimport lnlaw, rx(lnrdk) qx(lnofdi) thnum(1) grid(100) trim(0.05) bs(300)
Estimating  the  threshold  parameters:   1st ......  Done
Boostrap for single threshold
.................................................. +   50
.................................................. +  100
.................................................. +  150
.................................................. +  200
.................................................. +  250
.................................................. +  300

Threshold estimator (level = 95):
-----------------------------------------------------
     model |    Threshold         Lower         Upper
-----------+-----------------------------------------
      Th-1 |       3.2309        3.0561        3.5301
-----------------------------------------------------

Threshold effect test (bootstrap = 300):
-------------------------------------------------------------------------------
Threshold |       RSS        MSE      Fstat    Prob   Crit10    Crit5    Crit1
-----------+-------------------------------------------------------------------
    Single |   12.6651     0.0873      22.77  0.0233  14.0625  16.8218  24.6505
-------------------------------------------------------------------------------

Fixed-effects (within) regression               Number of obs      =       150
Group variable: region                          Number of groups   =        30

R-sq:  within  = 0.7440                         Obs per group: min =         5
       between = 0.7594                                        avg =       5.0
       overall = 0.7261                                        max =         5

                                                F(6,114)           =     55.21
corr(u_i, Xb)  = -0.8272                        Prob > F           =    0.0000

------------------------------------------------------------------------------
      lninno |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      lnofdi |  -.1406805    .055591    -2.53   0.013    -.2508059   -.0305551
       lnfdi |   .1416356   .1146057     1.24   0.219    -.0853975    .3686687
    lnimport |  -.2707573   .1594727    -1.70   0.092    -.5866716     .045157
       lnlaw |   1.454586   .6013024     2.42   0.017     .2634109    2.645762
             |
_cat#c.lnrdk |
          0  |   1.359866   .3818559     3.56   0.001     .6034124    2.116319
          1  |   1.427342   .3855023     3.70   0.000     .6636645    2.191019
             |
       _cons |   -30.8031   2.941327   -10.47   0.000    -36.62985   -24.97635
-------------+----------------------------------------------------------------
     sigma_u |  1.1333707
     sigma_e |   .3333124
         rho |   .9203962   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(29, 114) = 15.27                    Prob > F = 0.0000

. xthreg lninno lnofdi lnfdi lnimport lnlaw, rx(lnrdk) qx(lnofdi) thnum(2) grid(100) trim(0.05 0.05) bs(300 300)
Estimating  the  threshold  parameters:   1st ......  2nd ......  Done
Boostrap for single threshold
.................................................. +   50
.................................................. +  100
.................................................. +  150
.................................................. +  200
.................................................. +  250
.................................................. +  300
Boostrap for double threshold model:
.................................................. +   50
.................................................. +  100
.................................................. +  150
.................................................. +  200
.................................................. +  250
.................................................. +  300

Threshold estimator (level = 95):
-----------------------------------------------------
     model |    Threshold         Lower         Upper
-----------+-----------------------------------------
      Th-1 |       3.2309        3.0561        3.5301
     Th-21 |       3.2309        3.0561        3.5301
     Th-22 |       5.5177        5.4967        5.5530
-----------------------------------------------------

Threshold effect test (bootstrap = 300 300):
-------------------------------------------------------------------------------
Threshold |       RSS        MSE      Fstat    Prob   Crit10    Crit5    Crit1
-----------+-------------------------------------------------------------------
    Single |   12.6651     0.0873      22.77  0.0133  13.4831  17.2794  23.4312
    Double |   11.8439     0.0817      10.05  0.1567  11.4665  14.8246  19.2111
-------------------------------------------------------------------------------

Fixed-effects (within) regression               Number of obs      =       150
Group variable: region                          Number of groups   =        30

R-sq:  within  = 0.7549                         Obs per group: min =         5
       between = 0.7592                                        avg =       5.0
       overall = 0.7268                                        max =         5

                                                F(7,113)           =     49.71
corr(u_i, Xb)  = -0.8324                        Prob > F           =    0.0000

------------------------------------------------------------------------------
      lninno |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      lnofdi |   -.204005   .0614998    -3.32   0.001    -.3258473   -.0821628
       lnfdi |   .1120693   .1134016     0.99   0.325    -.1125998    .3367384
    lnimport |  -.3020981   .1573491    -1.92   0.057     -.613835    .0096388
       lnlaw |    1.25019   .5979375     2.09   0.039     .0655685    2.434812
             |
_cat#c.lnrdk |
          0  |   1.472659   .3786372     3.89   0.000     .7225109    2.222808
          1  |   1.549481   .3827601     4.05   0.000     .7911646    2.307798
          2  |   1.566729   .3839299     4.08   0.000     .8060942    2.327363
             |
       _cons |  -29.97367   2.914254   -10.29   0.000    -35.74733       -24.2
-------------+----------------------------------------------------------------
     sigma_u |  1.1527623
     sigma_e |  .32757397
         rho |   .9252839   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(29, 113) = 15.58                    Prob > F = 0.0000

_matplot e(LR21), columns(1 2) yline(7.35, lpattern(dash)) connect(direct)

老师,这是我的代码,单门槛程序跑完画LR图时系统提示matrix should have at least 2 columns,只有在双门槛检验之后才能作图,但是图很奇怪,请问老师这是什么问题,谢谢老师!

捕获.PNG (24.71 KB)

捕获.PNG

126
黃河泉 在职认证  发表于 2017-1-6 10:32:32
mufangzhu 发表于 2017-1-6 09:35
xthreg lninno lnofdi lnfdi lnimport lnlaw, rx(lnrdk) qx(lnofdi) thnum(1) grid(100) trim(0.05) bs(3 ...
你照著底下程序改一下
  1. xthreg i q1 q2 q3 d1 qd1, rx(c1) qx(d1) thnum(1) grid(400) trim(0.01) bs(100)
  2. _matplot e(LR), columns(1 2) yline(7.35, lpattern(dash)) ///
  3.         connect(direct) msize(small) mlabp(0) mlabs(zero) ///
  4.         ytitle("LR Statistics") xtitle("First Threshold") recast(line) name(LR)
复制代码
我试过,应该可以(一个门槛)! LR111.png

127
mufangzhu 发表于 2017-1-6 12:33:04
谢谢老师!太感谢您了!

128
黃河泉 在职认证  发表于 2017-1-7 06:51:10
mufangzhu 发表于 2017-1-6 12:33
谢谢老师!太感谢您了!
You are welcome.

129
西瓜statistic 发表于 2017-1-9 19:22:10
黄老师您好,想请教您一个问题。在做毕业论文,研究y与x1,x2的关系:计划实证部分打算第一部分做面板回归(得到的结果是y与x1、x2都是正相关的),第二部分做这三个变量之间的门槛效应,根据各省门槛值跨过情况探究区域异质性。想请问老师,这两章节矛盾不矛盾呢,因为面板回归是线性关系,后面门槛效应就不是单纯的线性关系了,所以我就想根据门槛值研究各省的门槛跨过情况。这样逻辑上可行吗?盼望老师的回复!

130
黃河泉 在职认证  发表于 2017-1-10 06:51:20
西瓜statistic 发表于 2017-1-9 19:22
黄老师您好,想请教您一个问题。在做毕业论文,研究y与x1,x2的关系:计划实证部分打算第一部分做面板回归( ...
这是完全OK的,应该这么说,一般线性面板回归提供初步结果,但你经过检定,发现其为非线性之门槛关系,所以进一步报告门槛结果!

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

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