help for ofrtplot

Plot observed, fitted and residuals versus `time' variable

ofrtplot [varname] [ , super ofplot(line_options) rplot(spike_options) combine(graph_options) ]


ofrtplot plots observed, fitted and residuals from the last model against a predictor. It is primarily designed for time series models and by default the predictor is whatever has been tsset as the time variable. However, other variables may be specified, whether or not data have been tsset.

Observed values are for the response or dependent variable from the last model, fitted values are whatever predict produces by default and residuals are whatever predict, res produces. The plot is restricted to the estimation sample.

By default, the plot has two panels. In the top panel, observed and fitted are plotted against the predictor. In the bottom panel, residuals are plotted against the predictor, by default as spikes from zero.


super specifies that plots are to be superimposed, not separate.

ofplot() specifies options of twoway line to tune the display of observed and fitted values.

rplot() specifies options of twoway spike to tune the display of residuals.

combine() specifies options to control the combination of the two graphs. This has no effect with super.


. tsset time . regress whatever time . ofrtplot

. gen gpm = 1 / mpg . regress gpm weight . ofrtplot, ofplot(recast(scatter) ms(Oh none) connect(none l))


Nicholas J. Cox, University of Durham, U.K. n.j.cox@durham.ac.uk


Denis de Crombrugghe suggested this program originally. Kit Baum made several useful suggestions.

Also see

On-line: help for predict, tsset, modeldiag