qq_plot | R Documentation |
Plots empirical quantiles of the studentized residuals from a linear model against the theoretical quantiles of a the normal distribution.
qq_plot(x, reps = 100, conf = 0.95, n.labels = 3, alpha = 0.4)
x |
an object of class |
reps |
integer; number of bootstrap replications for the confidence envelope (default=100) |
conf |
numeric; size of confidence interval (default= |
n.labels |
integer; the number of largest residuals to label ( default = 3). |
alpha |
numeric; transparency for plotted points (0 to 1, default=0.4). |
The function is a modification of the qqPlot function
in the car
package, using ggplot2
rather than
base
graphics. A robust linear regression line
is provided by the rlm function in the MASS
package.
a ggplot2
graph
qqPlot, qqnorm, rlm
mtcars$am <- factor(mtcars$am) fit <- lm(mpg ~ wt + am + disp + hp, mtcars) qq_plot(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.