RATS 10.1
RATS 10.1

Procedures /

THRESHTEST Procedure

Home Page

← Previous Next →

@THRESHTEST is a procedure for testing for a threshold break in a linear regression, assuming homoscedatic errors. An alternative testing procedure for the same type of break is @TSAYTEST.

 

@ThreshTest( options )  depvar start end

# list of explanatory variables (in Regression Format)

Parameters

depvar

dependent variable

start, end

range for regression. By default, the maximum range permitted by all variables involved in the regression.

Options

THRESH=threshold series. If omitted, time is used.

D=lag delay for threshold series [0]

 

TRIM=fraction of values to skip at both ends [.15]

 

NREPS=number of bootstrap replications [0]

If you provide a positive value, this computes an approximate significance level by a fixed regressor bootstrap.

 

SMPL=standard SMPL option[not used]

 

TITLE=title for report ["Test of Threshold Effect"]

[PRINT]/NOPRINT

GRAPH/[NOGRAPH]

If chosen, graphs the F-tests against the threshold values

Variables Defined

%CDSTAT

Maximum test statistic (REAL)

%SIGNIF

Bootstrapped p-value (REAL)

%RSS

Minimal sum of squared residuals (REAL)

%LOGL

Maximal log likelihood (REAL)

%%BREAKVALUE

Threshold value at the optimal break (REAL)

Example

This does threshold tests/estimation on an autoregression with skipped lags (just 1,2,3,4 and 12) using three different delays on the dependent variable as thresholds. At the end, it estimates the two branches of the autoregression at the break value found with delay of 1.

 

*

* Enders, Applied Econometric Time Series, 4th edition

* Example from Section 7.6, pp 433-436

* TAR Model for Unemployment Rate

*

calendar(m) 1960:1

open data unrate.xls

data(format=xls,org=columns) 1960:01 2013:6

*

graph(footer="Figure 7.6 The U.S. Unemployment Rate",vlabel="Percent")

# unrate

*

@bjident(diffs=1) unrate

*

* Note well that this data set has unemployment calculated to three

* decimal places, not the "headline" US unemployment numbers which just

* use one. At one decimal place, there are too few distinct values to

* use the difference as a threshold variable (almost all differences are

* -.2, -.1, 0, .1 or .2).

*

set dur = unrate-unrate{1}

*

linreg dur

# constant dur{1 to 4 12}

set arres = %resids

*

@regcorrs(number=12,report,dfc=5,title="Residuals from AR Model") arres

@regreset(h=4)

@mcleodli(number=2) arres

*

set res2 = arres^2

linreg res2

# constant res2{1 2}

*

* Regress residual on lag squared residual

*

linreg arres

# constant res2{1}

*

* This controls the results of the bootstrapping so the results will be

* reproducible.

*

* The graph is of F-tests, so reverses the highs and lows compared with

* the sums of squared residuals.

*

seed 2013

@threshtest(thresh=dur,d=1,graph,nreps=10000,trim=.1) dur

# constant dur{1 to 4 12}

compute breaklag1=%%breakvalue

*

seed 2013

*

@threshtest(thresh=dur,d=2,nreps=10000,trim=.1) dur

# constant dur{1 to 4 12}

compute breaklag2=%%breakvalue

*

seed 2013

@threshtest(thresh=dur,d=3,nreps=10000,trim=.1) dur

# constant dur{1 to 4 12}

compute breaklag3=%%breakvalue

 

****************

*

* Estimate the two branches of the model using the break on lag one.

*

linreg(smpl=dur{1}>breaklag1,title="Upper Branch") dur

# constant dur{1 to 4 12}

linreg(smpl=dur{1}<=breaklag1,title="Lower Branch") dur

# constant dur{1 to 4 12}

Sample Output

This is the output from the example when the lag delay of 1 is used. The largest F-statistic is at a break value of .07. The bootstrapped p-value shows this to be very significant.

 

Test of Null of No Threshold Against Alternative of Threshold

Under Maintained Assumption of Homoskedastic Errors

 

Dependent Variable      DUR

Threshold Variable      DUR{1}

Observations                629

From                    1961:02

To                      2013:06

Maximum F-Test           4.6584

Achieved at              0.0700

Bootstrap Replications    10000

Bootstrap P-Value        0.0025


 


Copyright © 2025 Thomas A. Doan