------------------------------------------------------------------------------- help forrdplot7-------------------------------------------------------------------------------

Graph residual distribution after regression-type command

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

rdplot7is for use afterregressand similar commands; see help on the command of interest.

Description

rdplot7graphs residual distributions. The residuals are, by default, those calculated bypredict, residualsor (if the previous estimation command wasglm) bypredict, response. The graph by default is a single or multiple dotplot, as produced bydotplot: histograms or box plots may be selected by specifying either thehistogramor theboxoption.

rdplot7is a renamed clone ofrdplot1.0.0 which is for Stata 7. Stata 8 users should userdplot2.0.0 or later.

Options

residualtypespecifies 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 andXas a placeholder for the residual variable name. Thusscale(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 ofvarname. Ifat()orgroup()is also specified, as below, groups are as specified by that option. Otherwise, groups are the distinct values ofvarname.

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

histogramspecifies that plots should be histograms.

boxspecifies that plots should be box plots.The default is that plots are dotplots.

graph_optionsare any of the options allowed with eitherdotplotorgraph,histogramorgraph, 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)

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

Also seeManual:

[R] regression diagnosticsOn-line: help for graph, regdiag; predict