面板单位根检验(Stata)

面板单位根检验(Stata)

对于包含时间序列较长的面板数据,在回归前需要进行单位根检验,否则可能存在虚假回归问题。检验方法在Stata使用手册中可以查阅得到,包括LLC检验、HT检验、Breitung检验、IPS检验、fisher 检验以及Hardri LM检验。下面具体介绍相关命令及使用方法。

**# versions 17.0
**# 1 数据准备
 webuse pennxrate,clear  // 调用网页数据
 describe                //描述统计
*=====================================
**# 2 LLC检验

/*
note:
仅适用于长面板数据,即时间长度远大于截面个数 
假定不存在截面相关,否则存在显著性扭曲,需要先去截面均值
允许不同截面内自回归系数相同
必须是平衡面板
*/

 xtunitroot llc lnrxrate , demean lags(aic 10) kernel(bartlett nwest)

 /* 
 option:
 demean表示去截面均值
 lags(#) 表示序列变量差分的滞后项数#,其中截面滞后阶数相同
 lags(aic #) lags(bic #)  lags(hqic #) 表示分别以aic bic hqic准则判定最大滞后阶数# 
 trend 表示加入趋势项并默认加入个体固定项
 noconstant 表示趋势项与个体项都不加入
 trend和noconstant都不加默认个体固定项
 kernel(kernel_spec) 为核函数,估计渐进方差,具体设定包括 ba pa qu等)
 结果输出:
 
 Levin–Lin–Chu unit-root test for lnrxrate
-----------------------------------------

H0: Panels contain unit roots               Number of panels  =    151
Ha: Panels are stationary                   Number of periods =     34
AR parameter: Common                        Asymptotics: N/T -> 0
Panel means:  Included
Time trend:   Not included                  Cross-sectional means removed
ADF regressions: 2.18 lags average (chosen by AIC)
LR variance:     Bartlett kernel, 3.50 lags average 

                 (chosen by Newey–West)
------------------------------------------------------------------------------
                    Statistic      p-value
------------------------------------------------------------------------------
 Unadjusted t       -22.1334
 Adjusted t*         -1.8763        0.0303
------------------------------------------------------------------------------
调整t统计量为  -1.8763 ,伴随概率 0.0303<0.05,拒绝H0: Panels contain unit roots 
 */

*=====================================
**# 3 HT 检验
/*
note:
适合于时间维度较短的微观面板数据
允许不同截面内自回归系数相同
必须是平衡面板
*/

 xtunitroot ht lnrxrate , demean 
 /*
 option:
 trend 表示加入趋势项并默认加入个体固定项
 noconstant 表示趋势项与个体项都不加入
 trend和noconstant都不加默认个体固定项
 demean表示去截面均值
 robust:允许截面相关
 lags(#) 预白噪声化 #,其中截面滞后阶数相同
 结果输出:Harris-Tzavalis unit-root test for lnrxrate
-------------------------------------------
H0: Panels contain unit roots               Number of panels  =    151
Ha: Panels are stationary                   Number of periods =     34
AR parameter: Common                        Asymptotics: N -> Infinity
Panel means:  Included                                   T Fixed
Time trend:   Not included                  Cross-sectional means removed
------------------------------------------------------------------------------
                    Statistic         z         p-value
------------------------------------------------------------------------------
 rho                  0.8184      -13.1239       0.0000
------------------------------------------------------------------------------
 z = -13.1239  ,伴随概率 0.000<0.01,拒绝H0: Panels contain unit roots 
 */                                                                  
 *=====================================
**# 4 Breitung 检验
 /*
 option:
 1)允许不同截面内自回归系数相同
 2)必须是平衡面板
 */
 
 xtunitroot breitung lnrxrate if g7, lags(3) robust

 /*
 option:
trend:加入时间趋势
noconstant : 趋势项与个体项都不加入
demean :去截面均值
robust:允许截面相关
lags(#)  :预白噪声数
结果:
Breitung unit-root test for lnrxrate
--------------------------------------
H0: Panels contain unit roots               Number of panels  =      6
Ha: Panels are stationary                   Number of periods =     34
AR parameter: Common                        Asymptotics:  T,N -> Infinity
Panel means:  Included                                        sequentially
Time trend:   Not included                  Prewhitening: 3 lags
------------------------------------------------------------------------------
                    Statistic      p-value
------------------------------------------------------------------------------
 lambda*             -1.2258        0.1101
------------------------------------------------------------------------------
 * Lambda robust to cross-sectional correlation
   统计量 lambda*  =  -1.2258  伴随概率  0.1101>0.1,不拒绝H0: Panels contain unit roots 
*/
 
 *=====================================
**# 5 IPS检验
/*
 不同截面内自回归系数不同
 允许非平衡
*/

 xtunitroot ips lnrxrate, lags(aic 5)

/*
option:
 trend :包含时间趋势
 demean :取截面均值
 lags(#) :为ADF回归设定滞后结构
结果输出:

Im–Pesaran–Shin unit-root test for lnrxrate
-------------------------------------------
H0: All panels contain unit roots           Number of panels  =    151
Ha: Some panels are stationary              Number of periods =     34
AR parameter: Panel-specific                Asymptotics: T,N -> Infinity
Panel means:  Included                                        sequentially
Time trend:   Not included
ADF regressions: 1.11 lags average (chosen by AIC)
------------------------------------------------------------------------------
                    Statistic      p-value
------------------------------------------------------------------------------
 W-t-bar            -15.2812        0.0000
------------------------------------------------------------------------------
Wt统计量 =  -15.2812 伴随概率0.000<0.01,拒绝H0: All panels contain unit roots 
*/
 *=====================================
**# 6 fisher 检验
/*
 不同截面内自回归系数不同
 允许非平衡
*/
 xtunitroot fisher lnrxrate, dfuller lags(3) drift
/*
option:
* dfuller :使用 ADF 单位根检验
* pperron  :使用pp单位根检验
* lags(#) :为ADF回归设定滞后结构
  demean 同上文

Fisher-type unit-root test for lnrxrate
Based on augmented Dickey–Fuller tests
---------------------------------------
H0: All panels contain unit roots           Number of panels  =    151
Ha: At least one panel is stationary        Number of periods =     34
AR parameter: Panel-specific                Asymptotics: T -> Infinity
Panel means:  Included
Time trend:   Not included
Drift term:   Included                      ADF regressions: 3 lags
------------------------------------------------------------------------------
                                  Statistic      p-value
------------------------------------------------------------------------------
 Inverse chi-squared(302)  P       916.1451       0.0000
 Inverse normal            Z       -18.8512       0.0000
 Inverse logit t(759)      L*      -19.5571       0.0000
 Modified inv. chi-squared Pm       24.9892       0.0000
------------------------------------------------------------------------------
 P statistic requires number of panels to be finite.
 Other statistics are suitable for finite or infinite number of panels.
------------------------------------------------------------------------------
上述逆卡方、逆正态、逆逻辑以及修正逆卡方统计量伴随概率均为0.000<0.01,故
拒绝H0: All panels contain unit roots   
*/
 *=====================================
**# 7 Hardri LM检验
 xtunitroot hadri lnrxrate, kernel(parzen 5)
/*
option作用同上文相关检验
  trend                  include a time trend
  demean                 subtract cross-sectional means
  robust                 allow for cross-sectional dependence
  kernel(kernel_spec)    specify method to estimate long-run varianc
*/

更多内容help xtunitroot


-END-
  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值