开始使用免费开始使用

为中位数生成自助法分布

在为单个统计量构建自助法分布时,我们先生成一系列自助重抽样,然后记录每个重抽样分布的相关统计量(此处为中位数)。

本练习中已为您加载 tidyverse(包括 ggplot2)以及 infer 包。

本练习是课程的一部分

R 中的数值数据推断

查看课程

交互式实操练习

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

# Generate bootstrap distribution of medians
rent_med_ci <- manhattan %>%
  # Specify the variable of interest
  ___(response = ___) %>%  
  # Generate 15000 bootstrap samples
  ___(reps = ___, type = "___") %>% 
  # Calculate the median of each bootstrap sample
  ___(stat = "___")
  
# View its structure
str(rent_med_ci)
编辑并运行代码