------------------------------------------------------------------------------- help forrvpplot2-------------------------------------------------------------------------------

Plot residuals versus predictor values after model fit

rvpplot2varname[,residualtypeforcerscale(exp)lowess[(lowess_options)]scatter_optionsplot(plot)]

Description

rvpplot2graphs a residual-versus-predictor plot (a.k.a. independent variable plot, a.k.a. carrier plot), a graph of the residuals versus the specified predictorvarnamefrom the last regression-type model. The residuals are, by default, those calculated bypredict, residualsor (if the previous estimation command wasglm) bypredict, response.

rvpplot2is for use afterregressand similar commands; see help on the command of interest. It is a generalisation of official Stata'srvpplot.

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.

forceallows you to specify a predictor variable not included in the previous model.

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

lowess[(lowess_options)] specifies that the residuals will be smoothed as a function of the predictor using twoway lowess (options may be specified).

scatter_optionsare options of twoway scatter.

plot(plot)provides a way to add other plots to the generated graph; see plot_option.

Examples

. reg width length. rvpplot2 length

. glm price weight, link(log). rvpplot2 weight, anscombe yli(0)

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

AcknowledgementsKit Baum identified an error in a previous version of this help.

Also seeOn-line: help for scatter, predict, modeldiag