進行回歸分析,一般需要研究係數的估計值是否穩定。很多經濟變量都存在結構突變問題,使用普通回歸的做法就是確定結構突變點,進行分段回歸。這就像我們高中學習的分段函數。但是對於大樣本、面板數據如何尋找結構突變點。所以本文在此講解面板門限回歸的問題,門限回歸也適用於時間序列(文章後面將介紹stata15.0新命令進行時間序列的門限回歸)。
門限效應,是指當一個經濟參數達到特定的數值後,引起另外一個經濟參數發生突然轉向其它發展形式的現象(結構突變)。作為原因現象的臨界值稱為門限值。例如,成果和時間存在非線性關係,但是在每個階段是線性關係。有些人將這樣的模型稱為門檻模型,或者門限模型。如果模型的研究對象包含多個個體多個年度,那麼就是門限面板模型。
常見模型如下:門檻回歸模型(threshold regression,也稱門限回歸):
漢森(Bruce E. Hansen)在門限回歸模型上做出了很多貢獻。 Hansen於1996年在《Econometrica》上發表文章《Inference when a nuisance parameter is not identified under the null hypothesis》,提出了時間序列門限自回歸模型(TAR)的估計和檢驗。之後,他在門限模型上連續追蹤,發表了幾篇經典文章,尤其是1999年的《Threshold effects in non-dynamic panels: Estimation, testing and inference》(Hansen (1999) 首次介紹了具有個體效應的面板門限模型的計量分析方法, 該方法以殘差平方和最小化為條件確定門限值, 並檢驗門限值的顯著性, 克服了主觀設定結構突變點的偏誤。具體思路是:選定某一變量作為門限變量, 根據搜尋到的門限值將回歸模型區分為多個區間, 每個區間的回歸方程表達不同, 根據門限劃分的區間將其他樣本值進行歸類, 回歸後比較不同區間係數的變化。),2000年的《Sample splitting and threshold estimation》和2004年與他人合作的《Instrumental Variable Estimation of a Threshold Model》。
在這些文章中,Hansen介紹了包含個體固定效應的靜態平衡面板數據門限回歸模型,闡述了計量分析方法。方法方面,首先要通過減去時間均值方程,消除個體固定效應,然後再利用OLS(最小二乘法)進行係數估計。如果樣本數量有限,那麼可以使用自舉法(Bootstrap)重複抽取樣本,提高門限效應的顯著性檢驗效率。在Hansen(1999)的模型中,解釋變量中不能包含內生解釋變量,無法擴展應用領域。Caner和Hansen在2004年解決了這個問題。他們研究了帶有內生變量和一個外生門限變量的面板門限模型。與靜態面板數據門限回歸模型有所不同,在含有內生解釋變量的面板數據門限回歸模型中,需要利用簡化型對內生變量進行一定的處理,然後用2SLS(兩階段最小二乘法)或者GMM(廣義矩估計)對參數進行估計。
二.顯著性檢驗
門檻回歸模型顯著性檢驗的目的是,檢驗以門檻值劃分的兩組樣本其模型估計參數是否顯著不同。
因此,不存在門檻值的零假設為:Ho:兩個係數相同。同時構造LM統計量:
其中,So是在零假設下的殘差平方和。由於LM統計量並不服從標準的分布。因此, Hansen(2000)提出了通過「自舉法」( Bootstrap)來獲得漸進分布的想法,進而得出相應的概率p值,也稱為 Bootstrap P值。
這種方法的基本思想是:在解釋變量和門檻值給定的前提下,模擬( Simulate)產生一組因變量序列,並使其滿足N(0,e2),其中e是式(4)的殘差項。每得到一個自抽樣樣本,就可以計算出一個模擬的エM統計量。將這一過程重複1000次。Hansen(1996)認為模擬產生的LM統計量大於式(6)的次數佔總模擬次數的百分比就是「自舉法」估計得到的P值。這裡的Bootstrap P值類似於普通計量方法得出的相伴概率P值。例如,當 Bootstrap P值小於0.01時,表示在1 %的顯著性水平下通過了LM檢驗,以此類推。
三.置信區間
以上的檢驗過程為只有一個門檻值的檢驗過程,為了能確定是否存在兩個門檻值或者是更多的門檻值,我們應當檢驗是否存在兩個門檻值,拒絕意味著至少存在一個門檻值。我們可以假設己經估計的第一個門檻值,然後開始尋找第二個門檻值。在確定有兩個門檻值後,再尋找第三個門檻值,方法都和前面的一樣,直至我們不能拒絕零假設。
閾值將一個狀態從另一個狀態描述出來。有一個效應(一組係數)達到閾值和另一個效應(另一組係數)。Stata的新門限命令適用於時間序列。門檻模型常用於時間序列數據。門檻可以是一個時間。例如,如果你認為投資策略在某個未知的日期發生了變化,你可以用一個模型來獲得日期的估計,並在它前後得到不同係數的估計。或者門檻值可以用另一個變量來表示。例如,在一定程度的通貨膨脹之外,央行會提高利率。你可以用一個模型來得到門檻值的估計值和兩邊的係數。
在Stata 15中,進行門檻回歸的命令為threshold,語法格式為:threshold depvar [indepvars] [if] [in], threshvar(varname) [options]
其中,其中, depvar為被解釋變量,indepvars為相關變量(解釋變量)。必選項 threshvar(varname) 表示變量 varname為門檻變量,選項nthresholds(#)指的是number of thresholds,這個命令默認只有一個門檻值(default is nthresholds(1))。也可以通過選擇項 nthresholds(#) 來指定多個門檻值,比如 nthresholds(2) 表示有 2 個門檻值,not allowed with optthresh()。
optthresh(#[, ictype]), select optimal number of thresholds less than or equal to #; not allowed with nthresholds(),計算最優的門檻個數,一般有Bayesian information criterion (BIC)、Akaike information criterion (AIC) 、Hannan-Quinn information criterion (HQIC)三個信息準則。其中默認使用BIC信息準則進行選擇。
菜單操作步驟為:Statistics > Time series > Threshold regression model
門檻回歸Example
調用數據:
webuse usmacro
下面進行門限回歸
threshold fedfunds, regionvars(l.fedfunds inflation ogap) threshvar(l2.ogap)
threshold fedfunds, regionvars(l.fedfunds inflation ogap) threshvar(l2.ogap) optthresh(5)
▲圖:結果輸出
xthreg需要stata13及以上版本
語法格式為:
xthreg depvar [indepvars] [if] [in], rx(varlist) qx(varname) [thnum(#) grid(#) trim(numlist) bs(numlist) thlevel(#) gen(newvarname) noreg nobslog thgiven options]
depvar被解釋變量,indepvars 解釋變量,qx(varname) is the threshold variable,門限變量,thnum(#) is the number of thresholds,在stata13.0中門檻值是必要項目,需要等於大於1,小於等於3,默認值為1,也就是至少存在三個門檻值。
rx(varlist) is the regime-dependent variable. Time-series operators are allowed. rx() is required. 區制變量或者制度變量
qx(varname) is the threshold variable. Time-series operators are allowed. qx() is required. 門限變量或者門檻變量
thnum(#) is the number of thresholds. In the current version (Stata 13), # must be equal to or less than 3. The default is thnum(1). 門檻個數
grid(#) is the number of grid points. grid() is used to avoid consuming too much time when computing large samples. The default is grid(300). 網格點數
trim(numlist) is the trimming proportion to estimate each threshold. The number of trimming proportions must be equal to the number of thresholds specified in thnum(). The default is trim(0.01) for all thresholds. For example, to fit a triple-threshold model, you may set trim(0.01 0.01 0.05).
bs(numlist) is the number of bootstrap replications. If bs() is not set, xthreg does not use bootstrap for the threshold-effect test. bootstrap迭代次數
thlevel(#) specifies the confidence level, as a percentage, for confidence intervals of the threshold. The default is thlevel(95). 置信區間,默認為95%,即thlevel(95)
gen(newvarname) generates a new categorical variable with 0, 1, 2, ... for each regime. The default is gen(_cat).
noreg suppresses the display of the regression result. 不顯示回歸結果
nobslog suppresses the iteration process of the bootstrap. 不顯示bootstrap迭代過程
thgiven fits the model based on previous results. options are any options available for [XT] xtreg.
Time-series operators are allowed in depvar, indepvars, rx(), and qx().
門檻回歸的案例
use hansen1999
Estimate a single-threshold model
xthreg i q1 q2 q3 d1 qd1, rx(c1) qx(d1) thnum(1) trim(0.01) grid(400) bs(300)
輸出結果包括四個部分。第一部分輸出門限估計值和自舉法的結果。第二部分列表輸出門限值及置信區間,Th-1代表單一門限估計值,Th-21 和Th-22代表雙門限回歸的兩個估計值,有時Th-21和Th-1相同。第三部分列出了門限檢驗,包括RSS、MSE、F統計量及概率值,以及10%、5%、1%的置信水平。第四部分是固定效應回歸結果。
語法格式為:xtthres varlist [if] [in] , thres(varname) dthres(varname) [ qn(#) bs1(#) bs2(#) bs3(#) levle(#) minobs(#) ]
thres(varname) specifies threshold variable, as denoted by q_it in Hansen(1999). Note that this option should not be omitted.
dthres(varname) specifies the variable that will show threshold effects, as denoted by x_it in Hansen(1999). This variable will be multipled by the indicator function I(.). Note that this option should not be omitted either.
qn(#) specifies the number of distinct values to be search in finding out the optimal estimate of threshold effects, r_hat, which will minimize the sum of square residuals of the model. The default value is 400.
bs1(#), bs2(#), bs3(#) specify the Bootstrap times in single threshold, double threshold and triple threshold model respectively. The default values are all 300.
level(#) specifies the confidence level, in percent, for confidence intervals. The default is level(95) or as set by set level; see help level.
minobs specifies the minimum number of observations in each of the regimes when searching for r_hats. The default is 10.
案例介紹1
xtthres tobin size tang prof, th(grow) d(tl)
xtthres tobin size tang prof, th(grow) d(tl) bs2(200) bs3(100) minobs(30)
xtthres tobin size tang prof if year<=2001, th(grow) d(tl) qn(200)
案例介紹2
cd E:\stata\results //設置工作路徑,保存輸出結果
use E:\stata\personal18\data\hansen1999, clear // 調入 Hansen99 數據
*-Table 1: Summary statistics
tabstat i q1 c1 d1, s(min p25 p50 p75 max) format(%6.3f) c(s)
Estimating
xtthres i q1 q2 q3 d1 qd1, th(d1) d(c1) min(120) bs1(300) bs2(300) bs3(200)
計量經濟分析方法與建模:EViews應用及實例
Hansen, Bruce E., 2000. "Sample Splitting and Threshold Estimation," Econometrica, 68, 575-603.(門檻回歸Bruce Hansen 在其個人網頁所提供的非官方 Stata 命令 ,下載地址為:http://www.ssc.wisc.edu/~bhansen/progs/progs_threshold.html)
Hansen, B. E. 1999. Threshold effects in non-dynamic panels: Estimation, testing, and inference. Journal of Econometrics 93: 345-368.
Wang, Qunyong, 2015. "Fixed-effect Panel Threshold Model Using Stata," The Stata Journal, 15(1), 121-134.
連玉君,程建. 不同成長機會下資本結構與經營績效之關係研究. 當代經濟科學,2006(2):97-103.
資源下載
Bruce E. Hansen "Sample splitting and threshold estimation" Econometrica (2000)中關於R、Stata、Gauss 、Matlab等軟體的Programs and Data下載地址為:https://www.ssc.wisc.edu/~bhansen/progs/ecnmt_00.html