PLOTS

Examples     References

PLOTS turns on the option which produces plots of actual and fitted values and residuals following estimation. The default is not to produce plots. It can also be used to turn on plots of CUSUM and CUSUMQ, which are used to look for "structural change" in a regression.

PLOTS [ALL CUSUM CUSUMSQ] ;

Usage

Include a PLOTS statement in your program before the first regression (OLSQ, AR1, INST, or LSQ) for which you wish to see residual plots. PLOTS remains in force until a NOPLOT statement is encountered.

Note that even though residual plots are not printed, residuals and fitted values will still be stored in data storage. To suppress this feature also, use the OPTIONS NORESID ; statement.

The regression diagnostics are based on the maximum values of the CUSUMs relative to their bounds or mean. They provide a compact alternative to the plot; for example, if a P-value is < .05, the CUSUM crosses a bound.

@CSMAX = max |.9479*@CUSUM(t)/@CSUB5%(t)|

@CSQMAX = max |@CUSUMSQ(t) - @CSQMEAN(t)|

The P-value %CSMAX is a function of @CSMAX given in Brown et al (1975). %CSQMAX is a function of @CSQMAX and the degrees of freedom, described in Durbin (1969). This P-value and the critical value for the CUSUMSQ plot are computed from the algorithms given in Edgerton and Wells (1994). The critical values are based on the asymptotic approximation when the number of observations is greater than 60, or on iterating to obtain the exact P-value calculation when the number of observations is less than 60.

All these results are based on recursive residuals, and they will not be calculated if the first K observations are not of full rank (where K = number of right hand side variables in the regression). Recursive residuals can also be computed by going backwards through the sample, and although this is not done at present in TSP, it may be useful if the plots are being used to locate points of structural change. Harvey (1990) contains some examples of interpreting the CUSUM and CUSUMSQ plots.

Examples

NOPLOT ; ? in this example, residual plots are printed only for the second regression.

OLSQ CONS C GNP ;

PLOTS ; AR1 CONS C GNP ;

 

PLOTS CUSUM CUSUMSQ; ? turns on the CUSUM plots for each regression until a                           

                                                      ?  NOPLOTS; is given).

PLOTS ALL;       ? turns on all plots (both CUSUMs plus residuals and fitted values).

REGOPT (PVPRINT) CSMAX CSQMAX; ? turns on the regression diagnostics.

REGOPT (PVPRINT) AUTO;                ? will also include the diagnostics (and P-values).

REGOPT (PVPRINT) ALL;                    ? will include both the diagnostics and all plots.

The CUSUM plots are done in low resolution with characters, so they can be included in standard output files and implemented on all platforms. The CUSUM plot stores: @CUSUM, @CSUB5%, and @CSLB5%. The CUSUMSQ plot stores: @CUSUMSQ, @CSQMEAN, @CSQUB5%, and @CSQLB5%. These variables can be stored without displaying the low resolution plot if you want to make only high-resolution plots. To do this, use:

REGOPT(CALC,NOPRINT) CUSUM CUSUMSQ ;

or

PLOTS CUSUM CUSUMSQ; SUPRES CUSUM CUSUMSQ ;

To then make high-resolution plots on the 386/486 and Mac versions of TSP, use:

PLOT (ORIGIN,PREVIEW) @CUSUM @CSUB5% @CSLB5% ;

PLOT (PREVIEW)   @CSQMEAN @CUSUMSQ @CSQUB5% @CSQLB5% ;

TSP only calculates the bounds automatically for the 5% two-tailed tests. Bounds for other size/one-tailed tests can be calculated manually with simple transformations of the bounds which are stored, using the appropriate critical values from a table.

References

Brown, R. L., J. Durbin, and J. M. Evans, "Techniques for Testing the Constancy of Regression Relationships over Time", Journal of the Royal Statistical Society - B, 1975.

Durbin, J., "Tests for Serial Correlation in Regression Analysis Based on the Periodogram of Least Squares Residuals," Biometrika, 1969.

Edgerton, David and Curt Wells, "On the Use of the CUSUMSQ Statistic in Medium Sized Samples", Oxford Bulletin of Economics and Statistics, 1994.

Harvey, A.C., The Econometric Analysis of Time Series, 2nd ed., Philip Allen, New York, 1990.