Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Foundations of Inference in R

Cursus bekijken

Oefeninstructies

  • 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.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

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
___
Code bewerken en uitvoeren