Open mamcisaac opened 2 years ago
The code throughout should be like the following to avoid this edge case of filtering out times when p_hat=0:
sample_prop_small <- global_monitor %>%
rep_sample_n(size = 10, reps = 25, replace = TRUE) %>%
group_by(replicate)%>%
summarize(p_hat = mean(scientist_work=="Doesn't benefit"))
sample_props_small often has fewer than the requested 25 elements.
The call to
filter(scientist_work == "Doesn't benefit")
is filtering out any replicates where there are no "Doesn't benefit"s in the small sample. As a result any replicates with p_hat=0 are filtered out and are not displayed.This issue is caused by using a small sample size and a true proportion close to 0 (p=.2).