This file is part of IDEAS, which uses RePEc data


[ Papers | Articles | Software | Books | Chapters | Authors | Institutions | JEL Classification | NEP reports | Search | New papers by email | Author registration | Rankings | Volunteers | FAQ | Blog | Help! ]

Graphics before and after model fitting

Author info | Abstract | Publisher info | Download info | Related research | Statistics
Author Info
Nicholas J. Cox () (University of Durham)

Additional information is available for the following registered author(s):

Abstract

It is commonplace to compute various flavours of residual and predicted values after fitting many different kinds of model. This allows production of a great variety of diagnostic graphics, used to examine the general and specific fit between data and model and to seek possible means of improving the model. Several different graphs may be inspected in many modelling exercises, partly because each kind may be best for particular purposes, and partly because in many analyses a variety of models - in terms of functional form, choice of predictors, and so forth - may be entertained, at least briefly. It is therefore helpful to be able to produce such graphs very rapidly. Official Stata supplies as built-ins a bundle of commands originally written for use after regress: avplot, avplots, cprplot, acprplot, lvr2plot, rvfplot and rvpplot. These were introduced in Stata 3.0 in 1992 and are documented at [R] regdiag. More recently, in an update to Stata 7.0 on 6 September 2001, all but the first two have been modified so that they may be used after anova. Despite their many uses, this suite omits some very useful kinds of plot, while none of the commands may be used after other modelling commands. The presentation focuses on a new set of commands, which are biased to graphics useful for models predicting continuous response variables. The ideal, approachable asymptotically, is to make minimal assumptions about which modelling command has been issued previously. The down-side for users is that if the data and the previous model results do not match the assumptions, it is possible to get either bizarre results or an error message. The commands which have been written include anovaplot shows fitted or predicted values from an immediately previous one-, two-, or three-way anova. By default the data for the response are also plotted. In particular, anovaplot can show interaction plots. indexplot plots estimation results (by default whatever predict produces by default) from an immediately previous regress or similar command versus a numeric index or identifier variable, if that is supplied, or observation number, if that is not supplied. Values are shown, by default, as vertical spikes starting at 0. ovfplot plots observed vs fitted or predicted values for the response from an immediately previous regress or similar command, with by default a line of equality superimposed. qfrplot plots quantile plots of fitted values, minus their mean, and residuals from the previous estimation command. Fitted values are whatever predict produces by default and residuals are whatever predict, res produces. Comparing the distributions gives an overview of their variability and some idea of their fine structure. By default plots are side-by-side. Quantile plots may be observed vs normal (Gaussian). rdplot graphs residual distributions. The residuals are, by default, those calculated by predict, residuals or (if the previous estimation command was glm) by predict, response. The graph by default is a single or multiple dotplot, as produced by dotplot: histograms or box plots may be selected by specifying either the histogram or the box option. regplot plots fitted or predicted values from an immediately previous regress or similar command. By default the data for the response are also plotted. With one syntax, no varname is specified. regplot shows the response and predicted values on the y axis and the covariate named first in the regress or similar command on the x axis. Thus with this syntax the plot shown is sensitive to the order in which covariates are specified in the estimation command. With another syntax, a varname is supplied, which may name any numeric variable. This is used as the variable on the x axis. Thus in practice regplot is most useful when the fitted values are a smooth function of the variable shown on the x axis, or a set of such functions given also one or more dummy variables as covariates. However, other applications also arise, such as plotting observed and predicted values from a time series model versus time. rvfplot2 graphs a residual-versus-fitted plot, a graph of the residuals versus the fitted values. The residuals are, by default, those calculated by predict, residuals or (if the previous estimation command was glm) by predict, response. The fitted values are those produced by predict by default after each estimation command. rvfplot2 is offered as a generalisation of rvfplot in official Stata.

Download Info
To download:

If you experience problems downloading a file, check if you have the proper application to view it first. Information about this may be contained in the File-Format links below. In case of further problems read the IDEAS help page. Note that these files are not on the IDEAS site. Please be patient as the files may be large.

File URL: http://fmwww.bc.edu/RePEc/usug2002/diag.pdf
File Format: application/pdf
File Function:
Download Restriction: no
File URL: http://www.stata.com/support/meeting/8uk/diag.html
File Format: text/html
File Function:
Download Restriction: no
File URL: http://fmwww.bc.edu/RePEc/usug2002/diag.zip
File Format: application/zip
File Function:
Download Restriction: no

Publisher Info
Paper provided by Stata Users Group in its series Dutch-German Stata Users' Group Meetings 2002 with number 3.

Download reference. The following formats are available: HTML (with abstract), plain text (with abstract), BibTeX, RIS (EndNote, RefMan, ProCite), ReDIF
Length:
Date of creation: 06 Jun 2002
Date of revision:
Handle: RePEc:boc:dsug02:3

Contact details of provider:
Postal: Administration Building, 140 Commonwealth Avenue, Chestnut Hill MA 02467
Phone: 617-552-3670
Fax: 617-552-2308
Email:
Web page: http://www.stata.com/meeting/2dutch
More information through EDIRC

For technical questions regarding this item, or to correct its listing, contact: (Christopher F Baum).

Related research
Keywords:

Other versions of this item:

This paper has been announced in the following NEP Reports:
Statistics
Access and download statistics

Did you know? To receive notification of recent additions to the database, subscribe to the free NEP reports.

This page was last updated on 2009-11-19.


This information is provided to you by IDEAS at the Department of Economics, College of Liberal Arts and Sciences, University of Connecticut using RePEc data on a server sponsored by the Society for Economic Dynamics.