Plots residuals (R.W. Payne).
Options
RESIDUALS = variate |
Residuals to plot |
---|---|
FITTEDVALUES = variate |
Fitted values against which to plot the residuals |
INDEX = variate or factor |
X-variable for an index plot; default !(1,2...) |
GRAPHICS = string token |
What type of graphics to use (lineprinter , highresolution ); default high |
TITLE = text |
Overall title for the plots; default * i.e. none |
Parameters
METHOD = string tokens |
Type of residual plot (fittedvalues , normal , halfnormal , histogram , absresidual , index ); default fitt , norm , half , hist |
---|---|
PEN = scalars, variates or factors |
Pen(s) to use for each plot |
Description
Procedure DRESIDUALS
provides up to four types of plots of residuals. These are selected using the METHOD
parameter, with settings: fitted
for residuals versus fitted values, normal
for a Normal plot, halfnormal
for a half-Normal plot, histogram
for a histogram of residuals, absresidual
for a plot of the absolute values of the residuals versus the fitted values, and index
for a plot against an “index” variable (specified by the INDEX
option). The PEN
parameter can specify the graphics pen or pens to use for each plot.
The residuals and fitted values must be supplied, in variates, using the RESIDUALS
and FITTEDVALUES
options, respectively. The TITLE
option can supply an overall title for the plots. By default, high-resolution graphics are used. Line-printer graphics can be requested instead, by setting option GRAPHICS=lineprinter
.
Options: RESIDUALS
, FITTEDVALUES
, INDEX
, GRAPHICS
, TITLE
.
Parameters: METHOD
, PEN
.
Method
For a Normal plot, the Normal quantiles are calculated as follows:
qi = NED( (i-0.375) / (n+0.25) )
while for a half-Normal plot they are given by
qi = NED( 0.5 + 0.5 × (i-0.375) / (n+0.25) )
Action with RESTRICT
If the variates are restricted, only the units not excluded by the restriction will be included in the graphs.
See also
Procedures APLOT
, RCHECK
, VPLOT
.
Commands for: Graphics.
Example
CAPTION 'DRESIDUALS example',\ !t('Data from Snedecor & Cochran (1980), Statistical',\ 'Methods, (Iowa State University Press), page 305;',\ 'also see the Guide to Genstat, Part 2, Section 4.1.');\ STYLE=meta,plain FACTOR [LABELS=!T(beef,cereal,pork); VALUES=(1...3)20] Source & [LABELS=!T(high,low); VALUES=3(1,2)10] Amount VARIATE [NVALUES=60] Gain READ Gain 73 98 94 90 107 49 102 74 79 76 95 82 118 56 96 90 97 73 104 111 98 64 80 86 81 95 102 86 98 81 107 88 102 51 74 97 100 82 108 72 74 106 87 77 91 90 67 70 117 86 120 95 89 61 111 92 105 78 58 82 : BLOCKSTRUCTURE TREATMENTSTRUCTURE Source*Amount ANOVA [PRINT=aovtable] Gain; RESIDUALS=Residual; FITTEDVALUES=Fitted DRESIDUALS [RESIDUALS=Residual; FITTEDVALUES=Fitted]\ fittedvalues, normal, halfnormal, histogram & [GRAPHICS=lineprinter] fittedvalues, normal, halfnormal, histogram