powered by
Plots the residual of observed variable.
residual.plot(Expected, Residuals, sigma, main = deparse(substitute(Expected)), col.pts = "blue", col.ctr = "red", col.sgm = "black", cex = 0.5, gray.scale = FALSE, xlab = "Predicted", ylab = "Residuals", ...)
Plot to visualize pattern of residulal value for the expected value.
Expected value.
Residual value.
Standard error.
main for the plot. See plot for detail.
plot
Color of the points.
Color of the line at zero.
Color of standard error line.
A numerical value giving the amount by which plotting text and symbols should be magnified relative to the default. See par for detail.
If TRUE, makes the plot into black and white. This option overwrites the color specification. Default is FALSE.
TRUE
Label for x axis.
Label for y axis.
Additional parameters passed to plot function.
Masanao Yajima yajima@stat.columbia.edu, M.Grazia Pittau grazia@stat.columbia.edu
old.par <- par(no.readonly = TRUE) x <- rnorm(100) y <- rnorm(100) fit <- lm(y~x) y.hat <- fitted(fit) u <- resid(fit) sigma <- sigma.hat(fit) residual.plot(y.hat, u, sigma) par(old.par)
Run the code above in your browser using DataLab