开始使用免费开始使用

观测统计量与 p 值

您现在已经得到了一个原假设分布。为了计算 p 值并权衡反对原假设的证据,您需要计算在 late_shipments 样本中观测到的比例差。

已提供 late_shipments;已加载 dplyrinferggplot2

本练习是课程的一部分

R 中的假设检验

查看课程

交互式实操练习

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

null_distn <- late_shipments %>% 
  specify(
    late ~ freight_cost_group, 
    success = "Yes"
  ) %>% 
  hypothesize(null = "independence") %>% 
  generate(reps = 2000, type = "permute") %>% 
  calculate(
    stat = "diff in props", 
    order = c("expensive", "reasonable")
  )

# Copy, paste, and modify the pipeline to get the observed statistic
obs_stat <- ___









# See the result
obs_stat
编辑并运行代码