开始使用免费开始使用

从 H0 生成数据

设想您在读报时看到有人声称:"所有美国人中有 3/4 相信死后有来生"。这可以解释为一个点原假设,即总体比例为 0.75。

请使用该假设生成一个数据集进行探索。

本练习是课程的一部分

R 中的分类数据推断

查看课程

交互式实操练习

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

# Generate one dataset under H0
sim1 <- gss2016 %>%
  # Specify the response and success
  ___(response = ___, success = ___) %>%
  # Hypothesize the null value of p
  ___(null = ___, p = ___) %>%
  # Generate a single simulated dataset
  ___(reps = ___, type = ___)

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