< -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
Feature
I use the Stat2 textbook in my regression course, and one homework problem asks students to do a randomization test for a multiple linear regression model. But rather than collecting the coefficient estimates from each randomization sample, the question asks students to find some summary statistic about the model, e.g. $R^2$. In other words, instead of running
null_fits <- gss %>%
specify(hours ~ age + college) %>%
hypothesize(null = "independence") %>%
generate(reps = 100, type = "permute") %>%
fit()
and getting a bunch of null slopes for age and college, I would like to get a bunch of null $R^2$ values. I know I can do this with purrr,
null_fits <- gss %>%
specify(hours ~ age + college) %>%
hypothesize(null = "independence") %>%
generate(reps = 100, type = "permute") %>%
split(.$replicate) %>%
map(~lm(hours~age+college, data = .x)) %>%
map(summary) %>%
map_dbl("r.squared")
But I wish it was better-facilitated by infer itself.
< -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
Feature
I use the Stat2 textbook in my regression course, and one homework problem asks students to do a randomization test for a multiple linear regression model. But rather than collecting the coefficient estimates from each randomization sample, the question asks students to find some summary statistic about the model, e.g.$R^2$ . In other words, instead of running
and getting a bunch of null slopes for$R^2$ values. I know I can do this with
ageandcollege, I would like to get a bunch of nullpurrr,But I wish it was better-facilitated by
inferitself.