powered by
Plot Cook's distances
plot_cook( model, n_highlights = 0, cut = FALSE, xlab = "Index", ylab = "Cook's distance", ... )
An invisible object representing Cook's distance values.
Model with cooks.distance() method
cooks.distance()
The number of observations with the highest Cook's distance to highlight on the plot. Defaults to 0 (no highlights).
Logical. If TRUE, adds a cutoff line at the mean plus four times the standard deviation of Cook's distance. Defaults to FALSE.
The label for the x-axis. Defaults to "Index".
The label for the y-axis. Defaults to "Cook's distance".
Further arguments for graphics::plot()
graphics::plot()
cooks.distance, plot
cooks.distance
plot
fit <- lm(mpg ~ cyl, data = mtcars) plot_cook(fit) plot_cook(fit, n_highlights = 2)
Run the code above in your browser using DataLab