Statistica observată și valoarea p
Acum ai o distribuție nulă. Pentru a obține o valoare p și a evalua dovezile împotriva ipotezei nule, trebuie să calculezi diferența dintre proporțiile observate în eșantionul late_shipments.
late_shipments este disponibil; dplyr, infer și ggplot2 sunt încărcate.
Acest exercițiu face parte din cursul
Testarea ipotezelor în R
Exercițiu interactiv practic
Încearcă acest exercițiu completând acest cod de exemplu.
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