Sample size for critical region
Using the randomization distributions with the small and big datasets, calculate different cutoffs for significance. Remember, you are most interested in a large positive difference in promotion rates, so you are calculating the upper quantiles of 0.90, 0.95, and 0.99.
A function for calculating these quantiles, calc_upper_quantiles()
is sown in the script.
This exercise is part of the course
Foundations of Inference in R
Exercise instructions
- As a reference point, run the call to
calc_upper_quantiles()
to calculate the relevant quantiles associated with the original dataset of 1000 permuted differences,disc_perm
. - Do the same for the small dataset,
disc_perm_small
… - and for the big dataset,
disc_perm_big
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
calc_upper_quantiles <- function(dataset) {
dataset %>%
summarize(
q.90 = quantile(stat, p = 0.90),
q.95 = quantile(stat, p = 0.95),
q.99 = quantile(stat, p = 0.99)
)
}
# Recall the quantiles associated with the original dataset
calc_upper_quantiles(disc_perm)
# Calculate the quantiles associated with the small dataset
___
# Calculate the quantiles associated with the big dataset
___