Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Studentized residual plot should return threshold value #19

Closed
aravindhebbali opened this issue Jun 3, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@aravindhebbali
Copy link
Member

commented Jun 3, 2017

ols_srsd_plot() should return the threshold value used to classify observations as outliers.

> library(caret)
> data("Sacramento")
> lm_fit2 <- lm(price  ~ beds + baths + log(sqft), data = Sacramento)
> k <- ols_srsd_plot(lm_fit2)

> k$Observation
 [1] 157 158 292 329 332 333 334 543 550 551 553 801 803 813 814

> k$`Studentized Residuals`
 [1] 3.315315 3.807551 4.447093 3.020921 3.546566 4.471201 7.311647 3.588165
 [9] 3.543963 4.098482 3.699032 4.058212 4.278508 4.593773 4.147903

@aravindhebbali aravindhebbali self-assigned this Jun 3, 2017

@aravindhebbali aravindhebbali added this to the v0.2.0 milestone Jun 5, 2017

@aravindhebbali

This comment has been minimized.

Copy link
Member Author

commented Jun 5, 2017

ols_srsd_plot() returns the threshold value used to classify observations as outliers.

> library(olsrr)
> library(caret)
> data("Sacramento")
> lm_fit2 <- lm(price  ~ beds + baths + log(sqft), data = Sacramento)
> k <- ols_srsd_plot(lm_fit2)

> k$outliers
# A tibble: 15 × 2
   Observation `Studentized Residuals`
         <int>                   <dbl>
1          157                3.315315
2          158                3.807551
3          292                4.447093
4          329                3.020921
5          332                3.546566
6          333                4.471201
7          334                7.311647
8          543                3.588165
9          550                3.543963
10         551                4.098482
11         553                3.699032
12         801                4.058212
13         803                4.278508
14         813                4.593773
15         814                4.147903
Warning message:
In unit %in% c("strwidth", "strheight", "strascent", "strdescent") :
  reached elapsed time limit

> k$threshold
[1] 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.