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

Add analysis documentation examples of bootstrapper() #2

Open
friendly opened this issue Mar 12, 2022 · 0 comments
Open

Add analysis documentation examples of bootstrapper() #2

friendly opened this issue Mar 12, 2022 · 0 comments

Comments

@friendly
Copy link

I'm looking for a way to use bootstrapper() to split a bootstrapped dataset into .draws, fit a model and return a data.frame or list of the coefficients (or other statistics). This should be a common enough task to warrant a documentation example.

Your RStudio2019 presentation mentions a function bootstrapify, but this doesn't exist in the package. I've tried a variety of things, but can't quite get my head around a solution.

library(dplyr)
library(broom)
library(ungeviz)
bsr <- bootstrapper(25)
models <- bsr(mtcars) %>%
  group_by(.draw) %>%
  summarise(b0 = coef(lm(mpg ~ hp, data = .))[1],
            b1 = coef(lm(mpg ~ hp, data = .))[2]) %>%
  ungroup()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant