MulaiMulai sekarang secara gratis

Statistik teramati dan p-value

Sekarang Anda memiliki sebaran nol. Untuk memperoleh p-value dan menimbang bukti terhadap hipotesis nol, Anda perlu menghitung selisih proporsi yang teramati pada sampel late_shipments.

late_shipments tersedia; dplyr, infer, dan ggplot2 sudah dimuat.

Latihan ini adalah bagian dari kursus

Pengujian Hipotesis di R

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

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
Edit dan Jalankan Kode