CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Foundations of Inference in R

Afficher le cours

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.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de 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
___
Modifier et exécuter le code