prop_test() for two samples
That took a lot of effort to calculate the p-value, so while it is useful to see how the calculations work, it isn't practical to do in real-world analyses. For daily usage, it's better to use the infer package.
Recall the hypotheses.
\(H_{0}\): \(late_{\text{expensive}} - late_{\text{reasonable}} = 0\)
\(H_{A}\): \(late_{\text{expensive}} - late_{\text{reasonable}} > 0\)
late_shipments is available; infer is loaded.
Deze oefening maakt deel uit van de cursus
Hypothesis Testing in R
Oefeninstructies
Using the late_shipments dataset, use prop_test() to perform a proportion test appropriate to the hypotheses.
- Specify a hypothesis of
lateversusfreight_cost_group. - Set the
orderof the freight cost groups. - Specify the
successvalue forlateand the type ofalternativehypothesis. - Don't use Yates' continuity correction.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Perform a proportion test appropriate to the hypotheses
test_results <- ___
# See the results
test_results