Usage
### This is a generic function with only one required argument:
residual.plots (m, ...)
### When the first argument is a linear model (of class lm), the form of the
### function is
## S3 method for class 'lm':
residual.plots(m,vars=~.,fitted=TRUE,plot=TRUE,
layout=NULL,ask,...)
### The following are three related functions:
resplot(m,varname="tukey",type="pearson",
plot=TRUE,add.quadratic=TRUE,
ylab=paste(string.capitalize(type),"Residuals"),...)
resid.curv.test(m,varname)
tukey.nonadd.test(m)
Arguments
vars
A one-sided formula that specifies a subset of the predictors.
One
residual plot is drawn for each column specified. The default
~.
is to plot against all predictors. For example, the
specification vars = ~.-X3
would
fitted
If TRUE, the default, plot against fitted values.
tukey
If TRUE, draw plot of residuals versus fitted values and compute
Tukey's test of non-additivity.
layout
If set to a value like c(1,1)
or c(4,3)
, the layout
of the graph will have this many rows and columns. If not set, the program will
select an appropriate layout. If the number of graphs exceed nine, you must
select th
ask
If TRUE, ask the user before drawing the next plot; FALSE if don't ask.
...
residual.plots
passes these arguments to resplot
.
resplot
passes them to plot
.
varname
Quoted variable name for the horizontal axis,
"tukey"
by
default for Tukey's test and the plot versus fitted values.
type
Type of residuals to be used. Pearson residuals are
appropriate for lm
objects since there are equivalent to ordinary residuals
with ols and correctly weighted residuals with wls.
ylab
Label for the yaxis. The default is the residual type.
add.quadratic
if TRUE, fits the quadratic regression of the
vertical axis on the horizontal axis.
plot
If TRUE, draw the plot(s).