进行回归分析,一般需要研究系数的估计值是否稳定。很多经济变量都存在结构突变问题,使用普通回归的做法就是确定结构突变点,进行分段回归。这就像我们高中学习的分段函数。但是对于大样本、面板数据如何寻找结构突变点。所以本文在此讲解面板门限回归的问题,门限回归也适用于时间序列(文章后面将介绍stata15.0新命令进行时间序列的门限回归)。

门限效应,是指当一个经济参数达到特定的数值后,引起另外一个经济参数发生突然转向其它发展形式的现象(结构突变)。作为原因现象的临界值称为门限值。例如,成果和时间存在非线性关系,但是在每个阶段是线性关系。有些人将这样的模型称为门槛模型,或者门限模型。如果模型的研究对象包含多个个体多个年度,那么就是门限面板模型。

一、history&Hansen

常见模型如下:门槛回归模型(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(广义矩估计)对参数进行估计。

接下来本文为大家介绍stata15.0进行门限回归新命令threshold以及王群勇老师编写的xthreg、xtptm和连玉君老师编写的命令。

二、Stata 15门槛回归:threshold

阈值将一个状态从另一个状态描述出来。有一个效应(一组系数)达到阈值和另一个效应(另一组系数)。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命令

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)

Estimate a triple-threshold model given the estimated result above

xthreg i q1 q2 q3 d1 qd1, rx(c1) qx(d1) thnum(3) trim(0.01 0.01 0.05) grid(400) bs(300 300 300)

输出结果包括四个部分。第一部分输出门限估计值和自举法的结果。第二部分列表输出门限值及置信区间,Th-1代表单一门限估计值,Th-21 和Th-22代表双门限回归的两个估计值,有时Th-21和Th-1相同。第三部分列出了门限检验,包括RSS、MSE、F统计量及概率值,以及10%、5%、1%的置信水平。第四部分是固定效应回归结果。

王群勇老师xtptm命令在此不做介绍,有兴趣可以尝试。

四、连玉君老师xtthres命令

语法格式为: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操作

阈值回归模型描述了一种简单的非线性回归模型。 TR规范很受欢迎,因为它们很容易。 估计和解释,并能产生有趣的非线性和丰富的动力学。 在TR的应用中,有样品分裂,多重平衡。 非常流行的阈值自回归(TAR)和自激励阈值自回归(SETAR)(Hansen 1999, 2011;波特2003)。

在功能强大的特性中,Eviews有选择最佳阈值TR模型选择工具。 能够从候选列表中,并且能够指定两种状态的变化和非变化的变量。例如,您可以轻松地指定两种模式的门限模型并允许EViews 估计最优变量和参数、阈值、系数和协方差。 并对变化和回归参数的估计。

Smooth Threshold Regression Estimation

EViews 9以及10.0新功能:Smooth Threshold Regression Estimation

Smooth Transition Autoregressive (STAR) modeling (Teräsvirta, 1994) is an extremely popular approach for nonlinear time series analysis. STAR models, which are a special case of Smooth Transition Regression (STR) models, embed regime-dependent linear auto-regression specifications in a smooth transition nonlinear regression framework.

EViews tools for estimation of two-regime STR models with unknown parameters for the shape and location of the smooth threshold. EViews estimation supports several different transition functions, provides model selection tools for selecting the best threshold variable from a candidate list, and offers the ability to specify regime varying and non-varying variables and variables that appear in only one regime.

To estimate a smooth transition model, Quick/Estimate Equation... from the main EViews menu, select THRESHOLD - Threshold Regression from the main Method dropdown menu near the bottom of the dialog, and click on the Smooth radio button in the Threshold type setting.

The options page allows you specify the transition function, covariance estimation method (including various robust estimators), and optimization settings.

Following estimation, EViews offers specialized views for the transition function and weights along with support for tests for linearity against STR alternatives and tests of no remaining nonlinearity and parameter constancy, alongside conventional tests for heteroskedasticity and serial correlation.

门限回归模型是一种重要的结构变化模型,当观测变量通过未知门限时,函数模型具有分段线性的特征,并且区制发生变化。门限回归模型很容易估计和解释,再加上它具备动态性,所以应用比较广泛。门限回归能够应用于多种模型中。

门限变量qt和解释变量Xt、Zt的特征决定了门限函数的类型。如果qt是yt的d期滞后值,则称为自激励(SE)模型;如果门限变量不是被解释变量的滞后变量,则为一般的门限回归(TR)模型。如果解释变量Xt、Zt中仅包含截距项和滞后的被解释变量,则表示自回归(AR)模型。在此基础上易于得出,自激励门限自回归(SETAR)模型中则包括自回归设定和滞后被解释变量两类要素。

Threshold Estimation in EViews

To estimate a threshold regression in EViews, selectObject/New Object.../EquationorQuick/Estimate Equation...from the main EViews menu, then selectThreshold - Thresh- old Regressionin theMethod drop-down menu. Alternatively, type threshold in the com- mand window and press Enter. You will see the following dialog:

stata15.0新命令threshold所用数据

Estimation Output

Criteria Graph and Table If you select View/Model Selection Summary from an estimated threshold equation you will be offered a choice of displaying a Criteria Graph or a Criteria Table:

These two views display the model selection criteria used to select the threshold variable in a line plot or a table, ordered by the selection criterion. For example, the criteria graph for this equation is shown below:

In this figure, the threshold variable whose model has the lowest AIC is clearly visible on the left of the graph. Here, we see the same set of results in table form. This view also includes information about the common sample used for model selection estimation, and the number of regimes employed for each candidate model.

六、参考文献及资源下载

计量经济分析方法与建模: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

由于作者计量经济学理论功底以及操作实践的局限性,文中难免有错误,请读者批评指正,更多关于门限回归的资源以及意见,欢迎留言交流。

matlab空间面板门槛,重磅!这可能是最全的面板门槛回归汇总了相关推荐

  1. matlab门槛回归,重磅!这可能是最全的门槛回归汇总了

    原标题:重磅!这可能是最全的门槛回归汇总了 来源 | 计量经济学服务中心综合整理,原文发于2017-12-24 重磅!这可能是最全的门槛回归汇总了 转载请联系 进行回归分析,一般需要研究系数的估计值是 ...

  2. 矩阵指数 matlab,空间计量-矩阵指数空间模型

    原标题:空间计量-矩阵指数空间模型 空间计量经济学 Matlab应用学习手册 空间计量经济学创造性地处理了经典计量方法在面对空间数据时的缺陷,考察了数据在地理观测值之间的关联.近年来在人文社会科学空间 ...

  3. Matlab | 空间域水印技术:LSB(Least Significant Bit):计算峰值信噪比PSNR(matlab源代码)

    ================================================ 博主github:https://github.com/MichaelBeechan 博主CSDN:h ...

  4. matlab gui表格行标1234没有,MATLAB GUI:滑塊作爲滾動條;子面板不夾

    長時間潛伏者 - 我真的很感謝社區的知識.我已經在這裏和其他地方看到過這個問題,但我還沒有找到合適的解決方案.如果我錯過了之前列出的答案,請張貼鏈接並接受我的道歉.MATLAB GUI:滑塊作爲滾動條 ...

  5. matlab consumption,Lesage matlab 空间

    压缩包 : matlab空间计量工具箱Lesage.rar 列表 matlab计量工具箱Lesage/coint/acf.m matlab计量工具箱Lesage/coint/adf.m matlab计 ...

  6. matlab sdm,运行matlab空间计量包中的sdm_d.m,出现?Undefined function or variable 'sdm_d'.

    运行matlab空间计量包中的sdm_d.m,出现??? Undefined function or variable 'sdm_d'. 程序如下,高手请解答,谢谢 % PURPOSE: An exa ...

  7. 【Matlab破损识别】机器视觉+SVM玉米种子破损识别(带面板)【含GUI源码 1651期】

    一.代码运行视频(哔哩哔哩) [Matlab破损识别]机器视觉+SVM玉米种子破损识别(带面板)[含GUI源码 1651期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考 ...

  8. 宝塔linux_宝塔面板建站基础教程:如何安装宝塔面板及建立博客网站

    大多数站长购买服务器特别是 Linux 服务器后一般都会选择安装宝塔面板来管理和维护服务器,但是有些新手站长总是担心自己不懂得如何在云服务器上安装宝塔面板,又或者成功安装了宝塔面板之后不懂得如何通过面 ...

  9. 小皮面板有php环境吗,体验phpStudy小皮面板创建LAMP/LNMP系统和建站图文

    在国庆节后老 左有看到原phpStudy面板新的Linux面板系统更新发布取名小皮面板(phpStudy Linux系统初次体验 – 一键安装phpStudy面板查看功能),初次体验这款面板之后我们肯 ...

  10. 重磅:服务器基础知识全解终极版(145页PPT)

    重磅:服务器基础知识全解终极版(145页PPT) 2020-12-26   阅 1  转 19 终极版来啦,本文内容共145页PPT干货,针对历史发布内容在CPU.内存.GPU.硬盘.网卡等9个章节做 ...

最新文章

  1. MATLAB实现微积分基础知识(求导,积分,插值,曲线拟合,最小二乘)
  2. 全球及中国液化天然气(LNG)行业建设规模现状及十四五产业规划报告2021年版
  3. 为什么方差的自由度是n-1啦?
  4. 修改oracle数据连接数据库,修改Oracle数据库的连接数
  5. OpenCV YOLO DNN(yolo_object_detection)
  6. 分布式监控系统开发【day37】:需求讨论(一)
  7. 服务器ie打不开http协议,在浏览器输入地址后,这个世界发生了什么(http协议浅谈)...
  8. 【K8S】Docker向私有仓库拉取/推送镜像报错(http: server gave HTTP response to HTTPS client)
  9. 作者:兰艳艳,女,中国科学院计算技术研究所副研究员、硕士生导师。
  10. core控制器属性注入的用处_asp.net-core – 如何使用Autofac和ASP.NET Core在控制器上启用属性注入?...
  11. php提示Undefined index的解决方法
  12. oracle数据库sga用途_oracle数据库的SGA和PGA,及分配指导
  13. 【软件工程】——软件需求说明书
  14. oracle建立图书管理数据库,Oracle数据库设计 图书管理系统
  15. Report WebCore crash to the ErrorReportUtils at:Fri Jul 24 09:59:08 格林尼治标准时间+0800 2015
  16. 校企联合学院分析ERP在家具行业中的应用
  17. 基于Python的离线OCR图片文字识别(三)——支持PDF文件
  18. 自动生成企业画像(标签)
  19. Don‘t Stop Pretraining: Adapt Language Models to Domains and Tasks
  20. ios-bug.html黑屏重启,iOS12曝重大BUG:iPhone黑屏无法充电!你中招没?

热门文章

  1. 关于mac m1 安装安卓模拟器
  2. 《SEM长尾搜索营销策略解密》一一1.1 做有个性的账户
  3. 主流游戏引擎分析 【端游 、页游 、手游 解析】
  4. 加法C语言基础程序,C语言菜鸟基础教程之加法
  5. MyBatis核心流程三大阶段之数据读写阶段
  6. win10怎么做文件服务器,win10怎么做云服务器
  7. 淘宝客如何赚钱?为什么很多人做淘宝客赚不到钱?
  8. Datawhale 天池二手车交易价格预测— Task1 赛题理解 +Task2 数据分析
  9. Linux如何进BIOS看硬盘,bios模式下怎么看硬盘
  10. [经典论道] 人工智能的四大哲学问题