เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Running the bootstrap

Good job writing calc_gender_coef() in the last exercise! This function creates a bootstrap sample, imputes it and, outputs the linear regression coefficient describing the impact of movie subject's being a female on the movie's earnings.

In this exercise, you will use the boot package in order to obtain a bootstrapped distribution of such coefficients. The spread of this distribution will capture the uncertainty from imputation. You will also look at how the bootstrapped distribution differs from a single-time imputation and regression. Let's do some bootstrapping!

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Handling Missing Data with Imputations in R

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Load the boot package.
  • Run bootstrapping on biopics, passing calc_gender_coef as statistic and set R to 50; assign the result to boot_results.
  • print() and plot() the bootstrapping results.

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Load the boot library
___

# Run bootstrapping on biopics data
boot_results <- ___(___, statistic = ___, R = ___)

# Print and plot bootstrapping results
___
___
แก้ไขและรันโค้ด