Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upStudentized residuals vs leverage plot should return threshold value #17
Comments
|
> library(olsrr)
> library(caret)
> data("Sacramento")
> lm_fit2 <- lm(price ~ beds + baths + log(sqft), data = Sacramento)
> k <- ols_rsdlev_plot(lm_fit2)
> k$leverage
Observation Leverage Studentized Residuals
1 153 0.005154382 2.131717
2 154 0.005179942 2.434828
3 157 0.006462719 3.315315
4 173 0.007670588 -2.016768
5 292 0.010350976 4.447093
6 294 0.004144309 2.274949
7 313 0.005912154 2.710143
8 321 0.006578520 2.208636
9 322 0.003590944 2.292741
10 329 0.003791068 3.020921
11 331 0.006412857 2.141023
12 333 0.009159017 4.471201
13 382 0.007381757 -2.153874
14 511 0.004838080 2.006514
15 519 0.002197520 2.445023
16 542 0.002910620 2.174906
17 543 0.001414019 3.588165
18 548 0.003441322 2.945940
19 549 0.006293067 2.494206
20 550 0.005176886 3.543963
21 551 0.003759983 4.098482
22 552 0.007418039 2.753821
23 553 0.006981809 3.699032
24 612 0.004851921 -2.221324
25 781 0.006582164 2.168987
26 784 0.006158209 2.231032
27 794 0.001802081 2.276834
28 801 0.005008438 4.058212
29 803 0.005968402 4.278508
30 807 0.002935425 2.967438
31 808 0.002940705 2.951958
32 811 0.006304095 2.243076
33 813 0.008970625 4.593773
Warning message:
In grob$name <- vp$name : reached elapsed time limit
> k$threshold
[1] 0.011 |
ols_rsdlev_plot()should return the threshold value used to detect outliers/high leverage observations.