1、The Stata Journal (2015)15, Number 1, pp. 121134Fixed-eect panel threshold model using StataQunyong WangInstitute of Statistics and EconometricsNankai UniversityTianjin, ChinaQunyongWAbstract. Threshold models are widely used in macroeconomics and financialanalysis for their simple and obvious econo
2、mic implications. With these models,however, estimation and inference is complicated by the existence of nuisanceparameters. To combat this issue, Hansen (1999, Journal of Econometrics 93: 345368) proposed the fixed-eect panel threshold model. In this article, I introducea new command (xthreg) for i
3、mplementing this model. I also use Monte Carlosimulations to show that, although the size distortion of the threshold-eect testis small, the coverage rate of the confidence interval estimator is unsatisfactory. Iinclude an example on financial constraints (originally from Hansen 1999, Journalof Econ
4、ometrics 93: 345368) to further demonstrate the use of xthreg.Keywords: st0373, xthreg, panel threshold, fixed eect1 IntroductionHeterogeneity is a common problem of panel data. That is to say, each individual in astudyisdierent, and structuralrelationships may varyacrossindividuals. Theclassicalfix
5、ed eect or random eect reflects only the heterogeneity in intercepts. Hsiao (2003)considers many varying slope models for this problem. Among these models, Hansens(1999) panel threshold model has a simple specification but obvious implications foreconomic policy. Though threshold models are familiar
6、 in time-series analysis, their usewith panel data has been limited.The threshold model describes the jumping character or structural break in the re-lationship between variables. This model type is popular in nonlinear time series, oneexample being the threshold autoregressive (TAR)model(Tong 1983)
7、. This model cancapture many economic phenomena. For example, using five-year interval averages ofstandard measures of financial development, inflation, and growth for 84 countries from1960 to 1995, Rousseau and Wachtel (2009) showed that there is an inflation thresh-old for the finance and growth r
8、elationship that lies between 1325%. When inflationexceeds the threshold, finance ceases to increase economic growth. Inflations eect oneconomic growth depends on the inflation level. High levels of inflation are harmful toeconomic growth, while low levels of inflation are beneficial to economic gro
9、wth. As an-other example, the technical spillover of foreign direct investment (FDI) has been widelystudied. Girma (2005) found that the productivity benefit from FDI increases with ab-sorptive capacity until some threshold level, at which point it becomes less pronounced.There is also a minimum abs
10、orptive capacity threshold level below which productivityspillovers from FDI are negligible or even negative.c 2015 StataCorp LP st0373122 Fixed-eect panel threshold model using StataThis article is arranged as follows. In section 2, I review some basic theories aboutfixed-eect panel threshold model
11、s. I then describe the new xthreg command in sec-tion 3. In section 4, I perform Monte Carlo simulations to study test-power distortionand the coverage rate of confidence interval estimators in finite samples. I illustrateuse of the command with an example from Hansen (1999) in section 5. In section
12、 6, Iconclude the article.2 Fixed-eect panel threshold models2.1 Single-threshold modelConsider the following single-threshold model:yit= +Xit(qitF1), namely,the proportion of FF1in bootstrap number B.2.2 Multiple-thresholds modelIf there are multiple thresholds (that is, multiple regimes), we fit t
13、he model sequentially.We use a double-threshold model as an example.yit= +Xit(qitF = 0.0000i Coef. Std. Err. t P|t| 95% Conf. Intervalq1 .0105555 .0008917 11.84 0.000 .0088075 .0123035q2 -.0202872 .0025602 -7.92 0.000 -.025306 -.0152683q3 .0010785 .0001952 5.53 0.000 .0006959 .0014612d1 -.0229482 .0
14、042381 -5.41 0.000 -.031256 -.0146403qd1 .0007392 .0014278 0.52 0.605 -.0020597 .0035381_cat#c.c10 .0552454 .0053343 10.36 0.000 .0447885 .06570221 .0862498 .0052022 16.58 0.000 .076052 .0964476_cons .0628165 .0016957 37.05 0.000 .0594925 .0661405sigma_u .03980548sigma_e .04922656rho .39535508 (frac
15、tion of variance due to u_i)F test that all u_i=0: F(564, 7338) = 6.90 Prob F = 0.0000Q. Wang 131The output consists of four parts. The first part outputs the estimation and boot-strap results. The second part outputs the threshold estimators and their confidenceintervals. Th-1 denotes the estimator
16、 in single-threshold models. In the thresholdestimator table, Th-21 and Th-22 denote the two estimators in a double-thresholdmodel. Sometimes, Th-21 isthesameasTh-1. The third part lists the threshold-eect test, including the RSS, the mean squared error (MSE), the F statistic (Fstat),the probability
17、 value of the F statistic (Prob), and critical values at 10%, 5%, and 1%significance levels (Crit10, Crit5,andCrit1, respectively). The fourth part outputsthe fixed-eect regression.Inthisexample, thesingle-thresholdmodelsestimatoris0.0154with95%confidenceinterval 0.0141, 0.0167. The F statistic is h
18、ighly significant. Therefore, we reject thelinear model and fit a double- or triple-threshold model.Next, we directly fit a triple-threshold model based on the result above. The trim-ming values are set to be 0.01 and 0.05 for the estimation of the second and thirdthresholds. Note that the trimming
19、proportion (0.01) for the single-threshold modelstill needs to be set because xthreg searches the second threshold using the trimmedseries in the single-threshold model. We set the bootstrap number to 300 for the double-and triple-threshold models; however, we set this to 0 for the single-threshold
20、modelbecause there is no need to use bootstrap for it again (the full option is bs(0 300 300).We suppress the output of bootstrap replications and the fixed-eect regression. xthreg i q1 q2 q3 d1 qd1, rx(c1) qx(d1) thnum(3) grid(400) trim(0.01 0.01 0.05 ) bs(0 300 300) thgiven nobslog noregEstimating
21、 the threshold parameters: 2nd 3rd DoneBoostrapping for threshold effect test: 2nd 3rd DoneThreshold estimator (level = 95):model Threshold Lower UpperTh-1 0.0154 0.0141 0.0167Th-21 0.0154 0.0141 0.0167Th-22 0.5418 0.5268 0.5473Th-3 0.4778 0.4755 0.4823Threshold effect test (bootstrap = 0 300 300):T
22、hreshold RSS MSE Fstat Prob Crit10 Crit5 Crit1Single 17.7818 0.0023 35.20 0.0033 11.9749 14.0259 22.8402Double 17.7258 0.0022 24.97 0.0133 10.8901 12.8409 27.6450Triple 17.7119 0.0022 6.20 0.5933 16.8006 21.8740 31.6187Note that xthreg gets a similar but not identical F statistic because of the ran-
23、domness of bootstrap sampling. Of course, this does not aect the conclusion. In thethreshold-eect test table, Single corresponds to H0(linear model) and Ha(single-threshold model), Double corresponds to H0(single-threshold model) and Ha(double-threshold model), and so forth. Obviously, the double-th
24、reshold model is accepted withprobability value 0.59.132 Fixed-eect panel threshold model using StataWe can view the threshold confidence interval by plotting the LR statistic. _matplot e(LR21), columns(1 2) yline(7.35, lpattern(dash) connect(direct) msize(small) mlabp(0) mlabs(zero) ytitle(“LR Stat
25、istics“) xtitle(“First Threshold“) recast(line) name(L R21) nodraw. _matplot e(LR22), columns(1 2) yline(7.35, lpattern(dash) connect(direct) msize(small) mlabp(0) mlabs(zero) ytitle(“LR Statistics“) xtitle(“Second Threshold“) recast(line) name( LR22) nodraw. graph combine LR21 LR22, cols(1)In figur
26、e 2, the dashed line denotes the critical value (7.35) at the 95% confidence level.010203040LR Statistics0 .2 .4 .6 .8First Threshold0510152025LR Statistics0 .2 .4 .6 .8Second ThresholdFigure 2. LR statistic of two thresholdsWe can also directly fit a triple-threshold model by using the following co
27、mmand:. xthreg i q1 q2 q3 d1 qd1, rx(c1) qx(d1) thnum(3) grid(400) trim(0.01 0.01 0.05) bs(300 300 300) nobslog noreg(output omitted)6ConclusionThe threshold model is a valuable tool for studying many economic phenomena, andthe panel threshold model has been widely used in financial and macroeconomi
28、c fields.In this article, I introduced the new xthreg command, which fits the fixed-eect panelthreshold modela threshold model that could also be a useful tool in financial andeconomic research. I performed Monte Carlo simulations to exemplify the eectivenessof using the bootstrap method in the thre
29、shold model, as originally suggested byHansen(1999). When using these methods, the significance test level of the threshold eectis very near to the nominal significance test level. I also showed that the thresholdQ. Wang 133estimator is consistent but the confidence interval gets wider and the cover
30、age rate ofthe threshold estimator gets bigger than the nominal level as n or T increases.7 AcknowledgmentsI thank H. Joseph Newton (the editor) for providing advice and encouragement. Pro-fessional and valuable comments from Zongwu Cai, Bruce E. Hansen, Ted Juhl, andan anonymous referee substantial
31、ly helped the revision of this article. The article isfinanced by the Natural Science Foundation of China (Grant Number 71101075).8 ReferencesAndrews, D. W. K., and P. Guggenberger. 2009. Hybrid and size-corrected subsamplingmethods. Econometrica 77: 721762.Bai, J. 1997. Estimating multiple breaks o
32、ne at a time. Econometric Theory 13: 315352.Bai, J., and P. Perron. 1998. Estimating and testing linear models with multiple struc-tural changes. Econometrica 66: 4778.Chan, K. S. 1993. Consistency and limiting distribution of the least squares estimatorof a threshold autoregressive model. Annals of
33、 Statistics 21: 520533.Enders, W., B. L. Falk, and P. Siklos. 2007. A threshold model of real U.S. GDP andthe problem of constructing confidence intervals in TAR models. Studies in NonlinearDynamics and Econometrics 11: 128.Girma, S. 2005. Absorptive capacity and productivity spillovers from FDI:Ath
34、resholdregression analysis export. Oxford Bulletin of Economics and Statistics 67: 281306.Gonzalo, J., and M. Wolf. 2005. Subsampling inference in threshold autoregressivemodels. Journal of Econometrics 127: 201224.Hansen, B. E. 1996. Inference when a nuisance parameter is not identified under thenu
35、ll hypothesis. Econometrica 64: 413430. 1997. Inference in TAR models. Studies in Nonlinear Dynamics and Economet-rics 2: 116. 1999. Threshold eects in non-dynamic panels: Estimation, testing, and infer-ence. Journal of Econometrics 93: 345368.Hsiao, C. 2003. Analysis of Panel Data. 2nd ed. Cambridg
36、e: Cambridge UniversityPress.Politis, D. N., J. P. Romano, and M. Wolf. 1999. Subsampling. New York: Springer.134 Fixed-eect panel threshold model using StataRousseau, P. L., and P. Wachtel. 2009. What is happening to the impact of financialdeepening on economic growth? Vanderbilt University Departm
37、ent of EconomicsWorking Papers No. 0915, Vanderbilt University Department of Economics.http:/ideas.repec.org/p/van/wpaper/0915.html.Tong, H. 1983. Threshold models in non-linear time series analysis. In Lecture Notes inStatistics, 21, ed. D. Brillinger, S. Fienberg, J. Gani, J. Hartigan, and K. Kric
38、keberg.Berlin: Springer.About the authorQunyongWangreceived hisPhDfromNankaiUniversity. HeworksattheInstituteofStatisticsand Econometrics at Nankai University. He is currently a visiting professor at the Universityof Kansas under the financial support of the China Scholarship Council.The Stata Journ
39、al (2015)15, Number 1, pp. 135154Frailty models and frailty-mixture models forrecurrent event timesYing XuCenter for Quantitative MedicineDukeNUS Graduate Medical SchoolSingaporeand Department of BiostatisticsSingapore Clinical Research InstituteSingaporetina.xuyingduke-nus.edu.sgYin Bun CheungCente
40、r for Quantitative MedicineDukeNUS Graduate Medical SchoolSingaporeand Department of International HealthUniversity of TampereFinlandyinbun.cheungduke-nus.edu.sgAbstract. The analysis of recurrent event times faces three challenges: between-subject heterogeneity (frailty), within-subject event depen
41、dence, and the possibil-ity of a cured fraction. Frailty can be handled by including a latent random-eectsterm in a Cox-type model. Event dependence may be considered as contributing tothe intervention eect, or it may be considered as a source of nuisance, dependingon the analysts specific research
42、questions. If it is seen as a nuisance, the analysiscan stratify the recurrent event times according to event order. If it is seen ascontributing to the intervention eect, stratification should not be used. Modelswith and without stratification for event order estimate two types of treatmenteects. T
43、hey are analogous to per-protocol analysis and intention-to-treat analy-sis, respectively. In the context of chronic disease treatment, we want to estimatewhether there is a cured fraction; for infectious disease prevention, this is called anonsusceptible fraction. In infectious disease prevention,
44、we want to understandwhether an intervention protects each of its recipients to some extent (“leaky”model) or whether it totally protects some recipients but oers no protection tothe rest (“all-or-none” model). The truth may be a mixture of the two modes ofprotection. We describe a class of regressi
45、on models that can handle all three is-sues in the analysis of recurrent event times. The model parameters are estimatedby the expectation-maximization algorithm, and their variances are estimated byLouiss formula. We provide a new command, strmcure, for implementing thesemodels.Keywords: st0374, st
46、rmcure, frailty models, frailty-mixture models, recurrentevent times, event dependence, cured fraction1 IntroductionRecurrent event times are common in biomedical and social studies. Some examplesinclude times to respiratory symptom exacerbations, hospital readmissions, and malariadisease episodes.
47、Compared with the analysis of time-to-first or only event, the analysisof recurrent event times oers some advantages. For example, in analysis of time-to-first event, the unobserved heterogeneity (or frailty) impacts on the individual follow-uptime (or person-time): subjects who are more frail will experience their first events andc 2015 StataCorp LP st0374