5
Whenever we make a linear regression, we need to verify that the hypotheses assumed for the model are correct. One of the best ways to do this is through diagnostic graphics. See the example below:
ajuste <- lm(Petal.Width ~ Petal.Length, data=iris)
library(ggfortify)
autoplot(ajuste)
There are four diagnostic graphs produced by the function autoplot
. Some of the points of these graphs are identified as deviating from the hypotheses formulated. For example, in the QQ Plot above, points 115, 135 and 142 are identified as out of expected for waste if they were distributed according to normal.
Is there any way to make this identification automatically in R? How could I pick up the output from autoplot
(or the native function itself plot
of R) and identify, for each plotted graph, which points violate the model’s hypotheses?
How disappointing to know that the function returns only the
label.n
more extreme waste. I always thought it was another identification criterion.– Marcus Nunes