THRESHTEST—Regression with threshold breaks

Use this forum to post complete RATS "procedures". Please be sure to include instructions on using the procedure and detailed references where applicable.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

THRESHTEST—Regression with threshold breaks

Unread post 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}
Attachments
unrate_decimal.xls
Data file for example
(49.5 KiB) Downloaded 1047 times
Last edited by TomDoan on Mon Apr 23, 2018 3:42 pm, edited 3 times in total.
Reason: Switch to description from HTML help
Poppelwops
Posts: 8
Joined: Thu Jan 22, 2009 11:39 am

Re: THRESHTEST - Regression with threshold breaks

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: THRESHTEST - Regression with threshold breaks

Unread post 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.
Poppelwops
Posts: 8
Joined: Thu Jan 22, 2009 11:39 am

Re: THRESHTEST - Regression with threshold breaks

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: THRESHTEST - Regression with threshold breaks

Unread post 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
cu_student
Posts: 10
Joined: Thu Apr 18, 2013 1:02 pm

Re: THRESHTEST - Regression with threshold breaks

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: THRESHTEST - Regression with threshold breaks

Unread post 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.
cu_student
Posts: 10
Joined: Thu Apr 18, 2013 1:02 pm

Re: THRESHTEST - Regression with threshold breaks

Unread post 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.
cu_student
Posts: 10
Joined: Thu Apr 18, 2013 1:02 pm

Re: THRESHTEST - Regression with threshold breaks

Unread post 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
moderator
Site Admin
Posts: 269
Joined: Thu Oct 19, 2006 4:33 pm

Re: THRESHTEST - Regression with threshold breaks

Unread post 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.
cu_student
Posts: 10
Joined: Thu Apr 18, 2013 1:02 pm

Re: THRESHTEST - Regression with threshold breaks

Unread post 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.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: THRESHTEST - Regression with threshold breaks

Unread post 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.
billmil
Posts: 5
Joined: Thu Mar 10, 2011 4:28 pm

Re: THRESHTEST—Regression with threshold breaks

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: THRESHTEST—Regression with threshold breaks

Unread post 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
Post Reply