xthreg (Stata Command)
xthregHansen?1999?
xthreg depvar [indepvars] [if] [in], rx(varlist) qx(varname) [thnum(#) grid(#) trim(numlist) bs(numlist) thlevel(#) gen(newvarname) noreg nobslog thgiven options]
depvar?indepvarsxthreg?Mata
rx(varlist)?
qx(varname)?
thnum(#)Stata 12?3thnum(1)?
grid(#)?grid(300)?
trim(numlist)thnum()trim(0.01)?
bs(numlist)bootstrapbootstrap?
thlevel(#)thlevel(95)?
gen(newvarname)0?1?2gen(_cat)?
noreg?
nobslogbootstrap?
thgiven?
options[XT] xtreg
depvar?indepvars?rx()?qx(). use hansen1999
. xthreg i q1 q2 q3 d1 qd1, rx(c1) qx(d1) thnum(1) trim(0.01) grid(400) bs(300)
. xthreg i q1 q2 q3 d1 qd1, rx(c1) qx(d1) thnum(3) trim(0.01 0.01 0.05) bs(0 300 300) thgiven
. xthreg i q1 q2 q3 d1 qd1, rx(c1) qx(d1) thnum(3) trim(0.01 0.01 0.05) bs(300 300 300)
LR
. _matplot e(LR21), columns(1 2) yline(7.35, lpattern(dash)) connect(direct) msize(small) mlabp(0) mlabs(zero) ytitle("LR Statistics") xtitle("First Threshold") recast(line) name(LR21) 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)
Gonzalo, J., and M. Wolf. 2005. Subsampling inference in threshold autoregressive models. Journal of Econometrics 127: 201-224. Hansen, B. E. 1999. Threshold effects in non-dynamic panels: Estimation, testing, and inference. Journal of Econometrics 93: 345-368. Politis, D. N., J. P. Romano, and M. Wolf. 1999. Subsampling. New York: Springer.