Closed ZexiCAI closed 2 years ago
Could you update the PR title as well?
Thank you for your prompt response! You may try the following codes:
test_fit1 <- lm(Sepal.Length ~ ., data=iris) autoplot(test_fit1, which=5, ncol=1) test_fit2 <- lm(Sepal.Length ~ ., data=iris[-1,]) autoplot(test_fit2, which=5, ncol=1)
We may not be expecting a huge different behavior with just the first data point removed (see attached plot). After the change, the second test plot will behave more similarly to the first plot. And in fact, the leverage of the smaller dataset is not constant, if you would have time to take a look at it.
I am embarrassed but I am not sure about how I should update the PR title. Do you have any rules on that? You might also change the title yourself if you find it more convenient.
Thank you!
The original source codes for checking constant leverage are functionally different from "plot.lm" function for base plot, which essentially produces a "Constant Leverage" plot for "which=5" with many datasets (if not most of them). The proposed changes follow from the source codes of "plot.lm", which uses the range of the leverages to check for constant leverage.