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}