What is the distribution I see in {infer} visualize() ?

at first, I want to see distribution from bootstrap.

use infer

set.seed(1)
gss %>%
  specify(response = hours) %>%
#  hypothesize(null = "point", mu = 40) %>% 
  generate(reps = 1000,type="bootstrap") %>% 
  calculate("mean") %>% 
  visualise()

use rsample

f<- function(x){
  x %>% 
    pluck() %>% 
    analysis() %>% 
    summarise(hours=mean(hours)) %>% 
    unlist()
}

set.seed(1)
df <- gss %>%
  bootstraps(1000)

tibble(hours=map_dbl(df$splits,f) ) %>% 
  ggplot(aes(x=hours))+
  geom_histogram(color="white",bins=15)+
  ggtitle("bootstrap distribution")

this two figure is same .

and next, I use this code.

set.seed(1)
gss %>%
  specify(response = hours) %>%
  hypothesize(null = "point", mu = 40) %>% 
  generate(reps = 1000,type="bootstrap") %>% 
  calculate("mean") %>% 
  visualise()

How do you create the data that under this distribution?

And where did the data created by generate () go?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.