Beobachtete Statistik und p-value
Du hast jetzt eine Nullverteilung. Um einen p-Wert zu erhalten und die Beweise gegen die Nullhypothese abzuwägen, musst du den Unterschied in den Anteilen berechnen, der in der Stichprobe late_shipments
beobachtet wird.
late_shipments
ist verfügbar; dplyr
, infer
und ggplot2
sind geladen.
Diese Übung ist Teil des Kurses
Hypothesentests in R
Interaktive Übung zum Anfassen
Probieren Sie diese Übung aus, indem Sie diesen Beispielcode ausführen.
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