STABTEST Procedure |
@STABTEST computes the Hansen (Nyblom-Hansen) stability test for a linear regression. It computes both individual and joint test statistics from Hansen(1992). This includes a test for the stability of the variance as well. @FLUX is a similar test which applies to non-linear models.
@STABTEST( 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
SMPL=standard SMPL option[not used]
ORDER=series with order in which data are to be added in testing [entry/time order]
[PRINT]/NOPRINT
Controls whether or not the regression and stability test results are printed
TITLE="title for report" ["Hansen Stability Test"]
Variables Defined
|
%HJOINT |
Joint stability test statistic (REAL) |
|
%HSTATS |
VECTOR of individual test statistics (for each coefficient then the variance) |
Example
*
* Johnston & DiNardo, Econometric Methods, 4th edition
* Numerical Illustration from section 4.4
* pp 121-126
*
open data auto1.asc
cal(q) 1959:1
data(format=prn,org=columns) 1959:1 1992:1 gcng gcngq gdc gydq pop16 x2 x3 y
*
* Figure 4.2 appears to show the series standardized, by subtracting the
* sample mean and dividing by the sample standard deviation. You can do
* this transformation with the instruction DIFF(STANDARDIZE).
*
diff(standardize) y 1959:1 1973:3 ys
diff(standardize) x3 1959:1 1973:3 x3s
diff(standardize) x2 1959:1 1973:3 x2s
graph(key=attached,klabels=||"Gas","Price","Income"||,$
footer="Figure 4.2 Gasoline Consumption, Income and Price") 3
# ys
# x2s
# x3s
*
* The StabTest procedure does the Hansen test for parameter instability.
*
@stabtest y 1959:1 1971:3
# constant x2 x3
Sample Output
@STABTEST includes the estimation of the linear regression. The test information follows the standard LINREG output. In this case, the null hypothesis of stability is very strongly rejected, with stability rejected for the joint test and each individual coefficient.
Linear Regression - Estimation by Least Squares
Dependent Variable Y
Quarterly Data From 1959:01 To 1971:03
Usable Observations 51
Degrees of Freedom 48
Centered R^2 0.9628561
R-Bar^2 0.9613084
Uncentered R^2 0.9999918
Mean of Dependent Variable -7.871992009
Std Error of Dependent Variable 0.118004981
Standard Error of Estimate 0.023211794
Sum of Squared Residuals 0.0258617954
Regression F(2,48) 622.1350
Significance Level of F 0.0000000
Log Likelihood 121.0979
Durbin-Watson Statistic 0.3162
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant -1.104123750 0.470426008 -2.34707 0.02309462
2. X2 -0.662340328 0.145458781 -4.55346 0.00003620
3. X3 0.847907643 0.060386831 14.04127 0.00000000
Hansen Stability Test
Test Statistic P-Value
Joint 4.06952983 0.00
Variance 0.12107450 0.47
Constant 0.92208827 0.00
X2 0.91741025 0.00
X3 0.91379801 0.00
Copyright © 2026 Thomas A. Doan