Page 1 of 1
THRESHTEST—Regression with threshold breaks
Posted: Fri Nov 04, 2011 12:43 pm
by TomDoan
@THRESHTEST is a procedure for testing for a threshold break in a linear regression, assuming homoscedatic errors.
Detailed description
Example
Code: Select all
*
* Enders, Applied Econometric Time Series, 3rd edition
* Example from Section 7.6, pp 451-454
* Threshold model for unemployment
*
open data unrate_decimal.xls
calendar(m) 1960:1
data(format=xls,org=columns) 1960:01 2008:12 unrate
*
graph(footer="U.S. Unemployment Rate")
# unrate 1960:1 2008:12
*
set dur = unrate-unrate{1}
linreg dur / e
# constant dur{1 to 4 12}
@regcorrs(number=10)
@regreset(h=4)
@mcleodli(number=2) e
*
set esq = e^2
linreg e
# constant esq{1}
*
set dulagged = dur{1}
*
* Note that this graphs the F statistics, which will be reversed
* vertically from the graph for the sum of squared residuals (that is,
* the break is indicated by the highest value, not lowest).
*
@threshtest(threshold=dulagged,graph) dur
# constant dur{1 to 4 12}
disp "Sum of Squared Residuals" %rss
*
* Trying other delays
*
set dulagged2 = dur{2}
set dulagged3 = dur{3}
*
@threshtest(threshold=dulagged2) dur
# constant dur{1 to 4 12}
disp "Sum of Squared Residuals" %rss
@threshtest(threshold=dulagged3) dur
# constant dur{1 to 4 12}
disp "Sum of Squared Residuals" %rss
*
* Redo the estimates with the chosen delay
*
@threshtest(threshold=dulagged) dur
# constant dur{1 to 4 12}
*
* Estimate the two branches of the model.
*
linreg(smpl=dulagged>%%breakvalue) dur
# constant dur{1 to 4 12}
linreg(smpl=dulagged<=%%breakvalue) dur
# constant dur{1 to 4 12}
Re: THRESHTEST - Regression with threshold breaks
Posted: Tue Nov 20, 2012 3:12 am
by Poppelwops
Dear Tom, are there any plans to implement a threshold approach with endogenous threshold variable? (such as in
http://www.economics.uoguelph.ca/Resear ... 2009_7.pdf, for instance). Best, Oliver
Re: THRESHTEST - Regression with threshold breaks
Posted: Wed Nov 21, 2012 7:18 am
by TomDoan
Not if there isn't more than that. I'm skeptical about any new technique where the authors haven't been able to come up with a convincing real-world application.
Re: THRESHTEST - Regression with threshold breaks
Posted: Mon Jan 14, 2013 10:11 am
by Poppelwops
Dear Tom,
many thanks for your reply (sorry for the late response). Since I am missing proper instruments for my (potentially endogenous) RHS variables, I decided to go back to the THRESHTEST proc.
One question regarding this: Is there an easy way to modify the code in order to allow for (regime-specific) heteroscedasticity?
Any help on this would be highly appreciated!
Many thanks in advance,
Oliver
Re: THRESHTEST - Regression with threshold breaks
Posted: Sun Jan 20, 2013 9:34 pm
by TomDoan
There's really no good way to modify @THRESHTEST, since it uses LM calculations to keep the computing time down. It would be easier to modify
@MULTIPLEBREAKS. That does full calculations of the regressions across each regime. Instead of keeping track of the sum of squared residuals for each interval:
compute intervalrss(s,e)=%rss
you would keep track of (minus the) subsample log likelihoods (since it's written to do a minimization rather than a maximization):
compute intervalrss(s,e)=%nobs=(e-s+1),+.5*%nobs*(log(%rss/%nobs)+1)
That will figure out the optimal regime breaks; you'll have to figure out how to adapt the output to handle the log likelihood
Re: THRESHTEST - Regression with threshold breaks
Posted: Fri May 10, 2013 7:03 pm
by cu_student
Tom,
If I am right, THRESHTEST tests only one structural break. Can THRESHTEST be used for testing 2 breaks (3 regimes)? If not, is there any simple way in RATS to get Hansens's bootstrapped p-values for 2 structural breaks?
Thanks
Re: THRESHTEST - Regression with threshold breaks
Posted: Fri May 10, 2013 8:06 pm
by TomDoan
cu_student wrote:Tom,
If I am right, THRESHTEST tests only one structural break. Can THRESHTEST be used for testing 2 breaks (3 regimes)? If not, is there any simple way in RATS to get Hansens's bootstrapped p-values for 2 structural breaks?
Thanks
For multiple breaks, use
@MultipleBreaks. The same basic idea for the fixed regressor bootstrap could be applied to that, though the amount of number-crunching required would be rather substantial.
Re: THRESHTEST - Regression with threshold breaks
Posted: Sat May 11, 2013 1:21 pm
by cu_student
Thanks Tom for your quick reply.
Let me rephrase the question. Is there a procedure in RATS that gives me Hansen's bootstrap p-value, for an input of two known thresholds? I am not looking to estimate two thresholds, rather I want to check for the significance of different threshold values.
Re: THRESHTEST - Regression with threshold breaks
Posted: Sat May 11, 2013 1:39 pm
by cu_student
And to add to my previous question. Once I have accepted the presence of a threshold, is a model with one or two threshold preferable? Is there a procedure that gives a bootstrap p-value for a 1-threshold vs 2-threshold.
Thanks Tom
Re: THRESHTEST - Regression with threshold breaks
Posted: Sat May 11, 2013 5:53 pm
by moderator
So you aren't estimating the break values, but want to input them? You don't need to use bootstrapping in that case since that would have standard asymptotics.
Re: THRESHTEST - Regression with threshold breaks
Posted: Sat May 11, 2013 6:46 pm
by cu_student
Thanks moderator.
You are right. I dont want to estimate breaks. I have already used 2 methods to estimate best breaks. First is using the code in sms_5_2.rpf (
http://www.estima.com/forum/viewtopic.p ... nses#p3402). My break values are -150 and +50. Second, I used the estimated break points from @mutiplebreaks is -200 and +50(as suggested by tom). My question is whether there is a procedure to test the statistical significance or get a p-value for my optimal threshold breaks, thats -150 and +50 or -200 and +50.(similar to the @threshtest which gives a p-value for the estimated threshold) And is there a way to get a p-value for a 1 break vs 2 break.
Thanks again for your time.
Re: THRESHTEST - Regression with threshold breaks
Posted: Mon Apr 23, 2018 3:43 pm
by TomDoan
Hansen(1996)'s bootstrap procedure is very specifically designed for doing hypothesis testing, not for generating confidence intervals on parameters. There's also a problem with what you're trying to do that your two estimates are, in fact, estimates and estimates with the same data set and are thus highly correlated.
Re: THRESHTEST—Regression with threshold breaks
Posted: Wed Jun 13, 2018 1:24 pm
by billmil
I attempt to use the threshtest, and I put in and get the following:
@threshtest(thresh=natstart, d=1, graph, nreps=10000) natstart
## OP3. This Instruction Does Not Have An Option D
>>>>thresh=natstart, d=<<<<
I have tried this several times, but I keep getting the same message about how this instruction does not have an option d. Any help would be greatly appreciated.
Thanks, Bill
Re: THRESHTEST—Regression with threshold breaks
Posted: Wed Jun 13, 2018 1:51 pm
by TomDoan
That's a relatively new addition to the procedure. Do Help-Update Procedures to get newer versions of that and other procedures:
https://estima.com/ratshelp/dialogupdateprocedures.html