0% found this document useful (0 votes)
67 views8 pages

Tsestatsbcusum

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views8 pages

Tsestatsbcusum

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Title stata.

com
estat sbcusum — Cumulative sum test for parameter stability

Description Quick start Menu for estat Syntax


Options Remarks and examples Stored results Methods and formulas
References Also see

Description
estat sbcusum performs a test of whether the coefficients in a time-series regression are stable
over time. The test statistic is constructed from the cumulative sum of either the recursive residuals
or the ordinary least-squares (OLS) residuals.
estat sbcusum requires that the current estimation results be from regress.

Quick start
Test stability of parameters based on the cumulative sum of recursive residuals, and plot the cumulative
sum with 95% confidence bands
estat sbcusum
Same as above, but use OLS residuals
estat sbcusum, ols

Menu for estat


Statistics > Postestimation

1
2 estat sbcusum — Cumulative sum test for parameter stability

Syntax
 
estat sbcusum , options

options Description
recursive use cumulative sum of recursive residuals; the default
ols use cumulative sum of OLS residuals
generate(newvar) create newvar containing the cumulative sum of the residuals
level(#) set confidence level; default is level(95)
Plot
recast(plottype) plot cumulative sum statistic using plottype
cline options affect rendition of the line plotting the cumulative sum statistic
Confidence bands
cbopts(area options) affect rendition of the confidence bands
Add plots
addplot(plot) add other plots to the graph of the cumulative sum
Y axis, X axis, Titles, Legend, Overall
twoway options any options other than by() documented in [G-3] twoway options
You must tsset your data before using estat sbcusum; see [TS] tsset.
collect is allowed; see [U] 11.1.10 Prefix commands.

Options
recursive computes the cumulative sum (cusum) test statistic and draws a cusum plot using the
recursive residuals. This is the default.
ols computes the cusum test statistic and draws a cusum plot using the OLS residuals.
generate(newvar) creates a new variable containing the cusum of the residuals at each time period.
level(#) specifies the default confidence level, as a percentage, for confidence bands, when they are
reported. The default is level(95) or as set by set level; see [U] 20.8 Specifying the width
of confidence intervals.

 Plot
recast(plottype) specifies that the cusum statistic be plotted using plottype. plottype may be scatter,
line, connected, area, bar, spike, or dropline; see [G-2] graph twoway.
cline options affect the rendition of the plotted cusum statistic. cline options are as described
in [G-3] cline options. When recast(plottype) is specified, the plot options are whatever is
appropriate for the specified plottype.

 Confidence bands
cbopts(area options) affects the rendition of the confidence bands for the cusum statistic.
area options are as described in [G-3] area options.
estat sbcusum — Cumulative sum test for parameter stability 3


 Add plots
addplot(plot) allows adding more graph twoway plots to the graph; see [G-3] addplot option.

 Y axis, X axis, Titles, Legend, Overall
twoway options are any of the options documented in [G-3] twoway options, except by(). These
include options for titling the graph (see [G-3] title options) and options for saving the graph to
disk (see [G-3] saving option).

Remarks and examples stata.com


Remarks are presented under the following headings:
Introduction
Cusum of recursive residuals
Cusum of OLS residuals

Introduction
estat sbcusum performs a test of parameter stability for linear regression coefficients. For instance,
estat sbcusum can test for structural breaks due to changes in regression coefficients over time.
The test can be performed using the cusum from recursive residuals (the default) or using the cusum
from OLS residuals.
In addition to reporting a test statistic, estat sbcusum plots the cusum of residuals and corre-
sponding confidence bands over the sample period.
Both cusum of residuals tests have the null hypothesis that all parameters are stable or constant
over time, but these tests do not require a specific alternative hypothesis. We reject this null hypothesis
based on the test statistic being larger than a critical value or based on the plotted cusum being
outside the confidence bands.
In their simulation study, Ploberger and Krämer (1992) show that the cusum test based on recursive
residuals has better power to detect parameter instability occurring early in the sample than the test
based on OLS residuals. By contrast, the OLS cusum statistic has better power to detect parameter
instabilities for breaks occurring later in the sample than the test based on recursive residuals.

Cusum of recursive residuals


The test statistic based on the cusum of recursive residuals was introduced in Brown, Durbin,
and Evans (1975). Under the null hypothesis, the recursive residuals are shown to be independent
and identically distributed as normal with 0 mean and constant variance. The cusum of the recursive
residuals also has a mean of 0 under the null hypothesis. If the coefficients change after a certain
time period, the plot of the recursive cusum process will drift away from the expected value of 0.
The limiting distribution of the sequence of the recursive cusum statistic is approximated by a
Brownian motion. The bounds of the Brownian process at a specified significance level are approximated
by a linear function. The sample cusum process crossing the theoretical bounds at any time point
signifies rejection of the null hypothesis. This is easily identified from a graph that plots the recursive
cusum statistic and the bounds. Alternatively, a test statistic based on the maximum of the recursive
cusum statistic can be used to test the null hypothesis.
4 estat sbcusum — Cumulative sum test for parameter stability

Example 1: Recursive cusum test


wpi1.dta contains quarterly data on the log of the U.S. Wholesale Price Index (WPI) from the
first quarter of 1960 to the fourth quarter of 1990 (Enders 2004). We want to know whether the
growth rate in the WPI has changed over time. To do this, we take the first differences of ln wpi;
see [U] 11.4.4 Time-series varlists.
The graph below shows a time-series plot of the growth rate of the WPI.
. use https://www.stata-press.com/data/r18/wpi1
. tsline D.ln_wpi

.08

.06

.04
D.ln_wpi

.02

-.02
1960q1 1970q1 1980q1 1990q1
Quarterly date

The growth rate changes in the middle of the sample, which leads us to believe that the mean of
the series may not be stable during the sample period. Because we are only interested in the average
growth rate of the series, we fit a constant-only linear regression model. We fit the model with the
quietly command because we are not interested in the coefficient estimates themselves. We then
use estat sbcusum to check the stability of the mean in our sample.
. quietly regress D.ln_wpi
. estat sbcusum, level(99)
Cumulative sum test for parameter stability
Sample: 1960q2 thru 1990q4 Number of obs = 123
H0: No structural break
Test Critical value
Type statistic 1% 5% 10%

Recursive 1.9030 1.1430 0.9479 0.8499

We can interpret the results by comparing the absolute value of the modified cusum statistic with
critical values; see Methods and formulas. We reject the null hypothesis of a constant mean at the
1% level because the test statistic value of 1.9030 exceeds the 1% critical level of 1.1430.
estat sbcusum — Cumulative sum test for parameter stability 5

Recursive cusum plot of D.ln_wpi


with 99% confidence bands around the null

-2

-4
1960q1 1970q1 1980q1 1990q1
Quarterly date

We can also examine the cusum plot. From the graph above, we see that the plot of the recursive
cusum process crosses the 99% confidence bands, which implies that the mean of the regression
model is not stable at the 1%, 5%, or 10% significance levels.
Moreover, the graph also provides information on the instability of the coefficients in the regression
model. Note that under the null hypothesis of no parameter instability, the expected value of the cusum
of recursive residuals is 0. In the graph above, the cusum of the recursive residuals starts crossing
the 99% confidence bands in the middle of the sample, which also indicates that the parameters of
the regression model become unstable during that time.

Cusum of OLS residuals


A similar test statistic is based on the cusum of OLS residuals. Under the null hypothesis, the
OLS residuals are correlated and heteroskedastic. The OLS residuals have an expected value of 0 in
the presence of an intercept or if the underlying process has a mean of 0 without an intercept. Their
cumulative sum always returns to 0, unlike the recursive cusum process, which will drift away from 0
after a structural break.
The limiting distribution of the OLS cusum statistic under the null hypothesis is approximated by
a Brownian bridge process (Ploberger and Krämer 1992). If there is a structural break at a certain
time period, the absolute value of the OLS cusum statistic peaks at that time and then returns to the
expected value of 0.
A plot with a constant upper bound and lower bound for a specified significance level is used as
a test for parameter stability. If the cusum statistic goes outside of the bounds, we reject the null
hypothesis of parameter stability. The plot also provides additional information on the timing of the
structural break. Alternatively, the absolute value of the OLS cusum statistic may also be used to test
the null hypothesis at a specified significance level.
6 estat sbcusum — Cumulative sum test for parameter stability

Example 2: OLS cusum test


Continuing with example 1, we also test the null hypothesis of parameter stability by using the
cusum of OLS residuals.
. estat sbcusum, ols level(99)
Cumulative sum test for parameter stability
Sample: 1960q2 thru 1990q4 Number of obs = 123
H0: No structural break
Test Critical value
Type statistic 1% 5% 10%

OLS 1.9854 1.6276 1.3581 1.2238

We reject the null hypothesis of parameter stability at the 1%, 5%, and 10% levels. The graph below
plots the OLS cusum process crossing the 99% band, which also implies rejection at the 1%, 5%, and
10% levels, confirming our results from the table.
OLS cusum plot of D.ln_wpi
with 99% confidence bands around the null
2

-1

-2
1960q1 1970q1 1980q1 1990q1
Quarterly date

Stored results
estat sbcusum stores the following in r():
Scalars
r(cusum) value of the test statistic
r(level) confidence level of confidence intervals
r(df) degrees of freedom
Macros
r(statistic) name of the statistic used; recursive or ols
r(tmins) formatted minimum time
r(tmaxs) formatted maximum time
Matrices
r(cvalues) vector of critical values
estat sbcusum — Cumulative sum test for parameter stability 7

Methods and formulas


Consider a linear regression model with k variables,
yt = x0t βt + et t = 1, . . . , T
where yt is the dependent variable and xt is a vector of covariates that may contain lags of the
dependent variable. βt is a vector of time-varying parameters and et is an independent and identically
distributed error term.
The cusum test based on recursive residuals is constructed using the one-step-ahead standardized
forecast error
yt − x0t β
b t−1
erec
t = q t = k + 1, . . . , T
1 + x0t X0t−1 Xt−1 xt


b t−1 is the estimate of β for the first t − 1 observations and X0t−1 = (x1 , . . . , xt−1 ). The null
where β
hypothesis for the test of parameter stability is H0 : βt = β, which implies constant parameters β.
Under the null hypothesis, the sequence {erec t } is independent and identically distributed N (0, σ ).
2

The cusum statistic is formed as


j=t
1 X rec
Ctrec = ej
σ
b
j=k+1
PT rec 2
where σb2 = {1/(T − k)} t=k+1 (erec rec
t − et ) . The limiting distribution of the sequence {Ct }
is a Brownian motion starting from 0 at time t = k + 1 with an expected value of 0 and variance
t − k.
Inference is based on the path of the sequence {Ctrec } crossing a theoretical boundary of a Brownian
motion with probability α. Brown, Durbin, and Evans (1975) approximate the nonlinear boundaries
by a pair of linear functions ±c{1 + 2(t − k)/(T − k)}, where the value of c is obtained by solving
the following equation:
Φ(3c) + exp(−4c2 ){1 − Φ(c)} = 0.5α
The test statistic is formed as
|Ctrec |
maxk+1≤t≤T
1 + 2 Tt−k
−k

The cusum statistic based on OLS residuals is constructed as


j=T
1 X
Ctols = √ eols
j
σ
e T j=1
PT ols 2
where eolst is the OLS residual and σ e2 = {1/(T − k)} t=k+1 (eols t − et ) . Ploberger and
Krämer (1992) show the limiting distribution of the sequence {Ctols } to be a Brownian bridge
process that starts at 0 at time t = k + 1 and ends at 0 at time T . The boundaries for the cusum
statistic are approximated by a pair of parallel lines with the probability of a sample process crossing
the boundaries being α.
The critical value c is obtained by solving the following equation:

X
2 (−1)j+1 exp(−2j 2 c2 ) = α
j=1

The test statistic is formed as the maximum of |Ctols |.


8 estat sbcusum — Cumulative sum test for parameter stability

References
Brown, R. L., J. Durbin, and J. M. Evans. 1975. Techniques for testing the constancy of regression relationships over
time. Journal of the Royal Statistical Society, Series B 37: 149–192. https://doi.org/10.2307/2986299.
Enders, W. 2004. Applied Econometric Time Series. 2nd ed. New York: Wiley.
Ploberger, W., and W. Krämer. 1992. The CUSUM test with OLS residuals. Econometrica 60: 271–285.
https://doi.org/10.2307/2951597.

Also see
[TS] estat sbknown — Test for a structural break with a known break date
[TS] estat sbsingle — Test for a structural break with an unknown break date
[TS] tsset — Declare data to be time-series data
[R] regress — Linear regression

Stata, Stata Press, and Mata are registered trademarks of StataCorp LLC. Stata and
®
Stata Press are registered trademarks with the World Intellectual Property Organization
of the United Nations. StataNow and NetCourseNow are trademarks of StataCorp
LLC. Other brand and product names are registered trademarks or trademarks of their
respective companies. Copyright c 1985–2023 StataCorp LLC, College Station, TX,
USA. All rights reserved.
For suggested citations, see the FAQ on citing Stata documentation.

You might also like