-------------------------------------------------------------------------------
help for rdplot7
-------------------------------------------------------------------------------

Graph residual distribution after regression-type command

rdplot7 [, residualtype scale(exp) by(varname) { at(numlist) | group(#) } { histogram | box } graph_options]

rdplot7 is for use after regress and similar commands; see help on the command of interest.

Description

rdplot7 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.

rdplot7 is a renamed clone of rdplot 1.0.0 which is for Stata 7. Stata 8 users should use rdplot 2.0.0 or later.

Options

residualtype specifies a type of residual other than the default. The following types are currently supported: anscombe, deviance, likelihood, pearson, residuals, response, rstandard, rstudent, score, working.

scale(exp) specifies a transformed scale on which to show the residuals using Stata syntax and X as a placeholder for the residual variable name. Thus scale(X^2) specifies squaring, to show relative contribution to residual variance; scale(abs(X)) specifies absolute value, to set aside sign; scale(sqrt(abs(X))) specifies root of absolute value, a useful scale on which to check for heteroscedasticity.

by(varname) specifies that plots should be given for groups of varname. If at() or group() is also specified, as below, groups are as specified by that option. Otherwise, groups are the distinct values of varname.

at(numlist) or group(#) specifies how groups of a classifying variable are to be determined. If by(varname) is specified, as above, at() or group() is applied to that variable. Otherwise, the first-named predictor or covariate used in the previous regression-type command is used. at() and group() are options of egen, cut(): see help on egen. In brief, at() specifies lower limits of user-defined classes and group() specifies the number of quantile-based groups with (approximately) equal frequency to be used. (With at(), supply one high value beyond the maximum of the data for best results.)

histogram specifies that plots should be histograms.

box specifies that plots should be box plots.

The default is that plots are dotplots.

graph_options are any of the options allowed with either dotplot or graph, histogram or graph, box. See help on dotplot or graph as appropriate.

Examples

. reg width length . rdplot7, g(3) . foreach X in width length { gen log`X' = log(`X') } . reg logwidth loglength . rdplot7, g(3) . glm price weight, link(log) . rdplot7, anscombe yli(0)

Author

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

Also see

Manual: [R] regression diagnostics On-line: help for graph, regdiag; predict