开始使用免费开始使用

临界区的样本量

使用小数据集和大数据集对应的随机化分布,计算不同的显著性截断值。请记住,您最关注的是晋升率的大幅正向差异,因此需要计算 0.90、0.95 和 0.99 的上分位数。

脚本中提供了用于计算这些分位数的函数 calc_upper_quantiles()

本练习是课程的一部分

R 推断基础

查看课程

练习说明

  • 作为参考点,运行对 calc_upper_quantiles() 的调用,以计算与包含 1000 个置换差值的原始数据集 disc_perm 对应的相关分位数。
  • 对小数据集 disc_perm_small 执行相同操作……
  • 以及对大数据集 disc_perm_big

交互式实操练习

通过完成这段示例代码来试试这个练习。

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
___
编辑并运行代码