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

Standardized residual chart should return the threshold value #18

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_chart() 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_chart(lm_fit2)

> k$Observation
 [1] 153 154 157 158 173 292 294 313 321 322 329 331 332 333 334 366 382 511
[19] 519 542 543 548 549 550 551 552 553 612 705 781 784 794 801 803 807 808
[37] 811 813 814

> k$`Studentized Residual`
 [1]  2.127658  2.428389  3.297610  3.780160 -2.013443  4.402775  2.269848
 [8]  2.700926  2.204036  2.287501  3.007781  2.136901  3.524647  4.426140
[15]  7.113351 -2.270632 -2.149663  2.003251  2.438491  2.170548  3.565425
[22]  2.933827  2.487219  3.522095  4.064036  2.744104  3.674012 -2.216630
[29] -2.322372  2.164670  2.226266  2.271718  4.024805  4.239164  2.955036
[36]  2.939765  2.238219  4.544811  4.112154

@aravindhebbali aravindhebbali self-assigned this Jun 3, 2017

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

aravindhebbali added a commit that referenced this issue Jun 5, 2017

@aravindhebbali

This comment has been minimized.

Copy link
Member Author

commented Jun 5, 2017

ols_srsd_chart() 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_chart(lm_fit2)

> k$outliers
   Observation Studentized Residual
1          153             2.127658
2          154             2.428389
3          157             3.297610
4          158             3.780160
5          173            -2.013443
6          292             4.402775
7          294             2.269848
8          313             2.700926
9          321             2.204036
10         322             2.287501
11         329             3.007781
12         331             2.136901
13         332             3.524647
14         333             4.426140
15         334             7.113351
16         366            -2.270632
17         382            -2.149663
18         511             2.003251
19         519             2.438491
20         542             2.170548
21         543             3.565425
22         548             2.933827
23         549             2.487219
24         550             3.522095
25         551             4.064036
26         552             2.744104
27         553             3.674012
28         612            -2.216630
29         705            -2.322372
30         781             2.164670
31         784             2.226266
32         794             2.271718
33         801             4.024805
34         803             4.239164
35         807             2.955036
36         808             2.939765
37         811             2.238219
38         813             4.544811
39         814             4.112154
Warning message:
In grid.Call.graphics(C_setGPar, temp) : reached elapsed time limit

> k$threshold
[1] 2
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.