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

DFFITs plot should return the threshold value #15

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_dffits_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_dffits_plot(lm_fit2)

> k$Observation
 [1]  19  48  69  74 109 121 153 154 155 156 157 158 173 278 292 294 313 315
[19] 321 322 327 329 331 332 333 334 366 382 443 457 511 543 544 547 548 549
[37] 550 551 552 553 555 599 612 705 761 781 784 801 803 805 806 807 808 809
[55] 810 811 812 813 814

> k$DFFITs
 [1]  0.1404691 -0.1609518 -0.1907771 -0.1536721 -0.1682443 -0.1427501
 [7]  0.1534405  0.1756946  0.1354857  0.1338164  0.2673870  0.5407350
[13] -0.1773137 -0.1657323  0.4548061  0.1467572  0.2090031  0.1698078
[19]  0.1797304  0.1376387  0.1711760  0.1863567  0.1720062  0.5773783
[25]  0.4298794  1.0215338 -0.2745943 -0.1857416  0.1330492 -0.1402640
[31]  0.1399046  0.1350228  0.1904313  0.1944542  0.1731152  0.1984881
[37]  0.2556528  0.2517874  0.2380658  0.3101655 -0.2244189 -0.2461501
[43] -0.1551047 -0.3362356 -0.1379339  0.1765531  0.1756202  0.2879229
[49]  0.3315288  0.1425844  0.2055529  0.1610110  0.1603154  0.1559717
[55]  0.1618058  0.1786605  0.2265931  0.4370566  0.4710879

@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_dffits_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_dffits_plot(lm_fit2)

> k$outliers
# A tibble: 59 × 2
   Observation     DFFITs
         <int>      <dbl>
1           19  0.1404691
2           48 -0.1609518
3           69 -0.1907771
4           74 -0.1536721
5          109 -0.1682443
6          121 -0.1427501
7          153  0.1534405
8          154  0.1756946
9          155  0.1354857
10         156  0.1338164
# ... with 49 more rows
Warning message:
In dontCheck(fnname) : reached elapsed time limit

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