-
Notifications
You must be signed in to change notification settings - Fork 303
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
boot
tidier doesn't work for some conf.method
types
#581
Comments
# setup
set.seed(123)
library(boot)
# data
clotting <- data.frame(
u = c(5, 10, 15, 20, 30, 40, 60, 80, 100),
lot1 = c(118, 58, 42, 35, 27, 25, 21, 19, 18),
lot2 = c(69, 35, 26, 21, 18, 16, 13, 12, 12)
)
# model
g1 <- glm(lot2 ~ log(u), data = clotting, family = Gamma)
# bootstrapping function
bootfun <- function(d, i) {
coef(update(g1, data = d[i, ]))
}
# using the custom bootstrapping function
bootres <- boot::boot(
data = clotting,
statistic = bootfun,
R = 999
)
# getting all confidence intervals
broom::tidy(
x = bootres,
conf.int = TRUE,
conf.method = "all"
)
#> Warning in FUN(X[[i]], ...): bootstrap variances needed for studentized
#> intervals
#> Warning in FUN(X[[i]], ...): bootstrap variances needed for studentized
#> intervals
#> # A tibble: 2 x 6
#> term statistic bias std.error conf.low conf.high
#> <chr> <dbl> <dbl> <dbl> <list> <list>
#> 1 (Intercept) -0.0239 -0.00184 0.00378 <NULL> <NULL>
#> 2 log(u) 0.0236 0.000559 0.00114 <NULL> <NULL> Created on 2019-01-12 by the reprex package (v0.2.1) |
For the studentized interval, |
What would |
Yeah, but I am not sure how helpful that would be. Just wanted to bring up the possibility that this particular argument can get this particular input and the method should have some way to handle it. If not, it can print a helpful error message. |
Good point. Let's error on |
I'm going to work on this today at ChiRUnconf19 |
I fixed the issue for The |
Quote: "Supporting |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
Tidier for
boot
object works inconsistently.Here is a custom function to get confidence interval for Spearman's rho using
boot
package.NA
s insteadCreated on 2019-01-12 by the reprex package (v0.2.1)
Session info
The text was updated successfully, but these errors were encountered: