其中,作为解释变量的xi是一个m维的列向量。qi被称为“门槛变量”, Hansen(2000)认为门槛变量既可以是解释変量xi中的一个回归元,也可以作为一个独立的门槛变量。 而面板门槛模型已经广泛应用到实证研究中,2015年开发出来的xthreg命令可以进行hansen所提出的门槛回归模型。 Hansen's(1999)模型是静态的另外固定效应回归估计要求协变量是强外生变量,估计值是一致的。——然而,在许多实际应用程序中,强外生性可能具有限制性。因此,Seo and Shin (2016)将该模型扩展到动态面板模型。 假设如下一个动态面板门槛模型:
xthenreg depvar [varlist (q x1 x2 ...)] [if] [in] [, options]
其中depvar是因变量,而indepvars是解释变量变量。
使用该命令前需要注意: 1. xtset应该在运行之前完成。此外,变量必须为事先按(i)面板变量和(ii)时间变量排序。(xtset should be done before running this. Moreover variables must be sorted by (i) panel variable and (ii) time variable beforehand.) 2. 需要强平衡的面板数据(Strongly balanced panel data is required.) 3.Inputs 应该 把 y q x1 x2 …… , 其q为门槛变量, x1 和 x2这些称为解释变量(Inputs should be put as y q x1 x2 …… , where q is the threshold variable and x1 x2 ……are other independent variables.) 4. moremata library is required since this command use mm quantile func-tion.
5. When there are endogeneous independent variables, endogenous option
should be set. For example, if x1 is exogeneous and x2 is endogeneous,
the input must be y q x1, endo(x2).
2 option选项介绍

inst(varlist) species the list of additional instrumental variables.
static sets the model static. The default model is dynamic. In contrast
with dynamic model, static model does not automatically include L.y as inde-
pendent variable.
kink sets the model kink.
grid_num(integer) determines the number of grid points to estimate the thresh-
old . The default is 20.
trim_rate(real) determines the trim rate when constructing a grid for es-
timating r. The default is 0.4.
h_0(real) determines a parameter for Silverman's rule of thumb used to ker-
nel estimation. The default is 1.5.
boost(integer) The number of bootstrapping for linearity test. The default
is 0.
3 案例应用介绍 我们应用我们的方法来评估肥胖对工人生产力的影响。肥胖是用体重指数(BMI)来衡量的,体重(公斤)除以身高(米)的平方。BMI在25到30之间的人被认为超重,BMI在30或更高的人被视为肥胖。 使用数据来自British Cohort Study,我们研究了BMI与工作时间的关系。更多的详细讨论见Kim(2019)。 加载数据后,首先需要声明数据是panel。xthenreg的默认模型是一个动态模型。因为我们认为是静态的模型,而不是动态模型,我们使用静态选项。案例1::
use hour, clearxtset ilabel timexthenreg hour bmi hsize, endo(bmi) inst(bweight bmic bmim bmid hsize) kink static结果为:
xthenreg hour bmi, endo(bmi) exo(hsize) inst(bweight > bmic bmim bmid) kink staticWe can also change the set of included and excluded instruments using the inst option. The number of moment conditions varies accordingly.
xthenreg hour bmi hsize, endo(bmi) inst(bweight bmic bmim bmid) kink static
xthenreg hour bmi if region==1, endo(bmi) exo(hsize) inst(bweight bmic bmim bmid) kink static
Next we consider discontinuity in BMI eect without imposing a kink in the model.

By taking rst difference, we obtain the following model and estimate it with only static option.

xthenreg hour bmi, endo(bmi) exo(hsize) inst(bweight bmic bmim bmid) static