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.
This exercise is part of the course
Hypothesis Testing in R
Exercise instructions
Using the late_shipments
dataset, use prop_test()
to perform a proportion test appropriate to the hypotheses.
- Specify a hypothesis of
late
versusfreight_cost_group
. - Set the
order
of the freight cost groups. - Specify the
success
value forlate
and the type ofalternative
hypothesis. - Don't use Yates' continuity correction.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Perform a proportion test appropriate to the hypotheses
test_results <- ___
# See the results
test_results