From t to p
Previously, you calculated the test statistic for the two-sample problem of whether the mean weight of shipments is lower for shipments that weren't late (late == "No") compared to shipments that were late (late == "Yes"). In order to make decisions about it, you need to transform the test statistic with a cumulative distribution function to get a p-value.
Recall the hypotheses:
\(H_{0}\): The mean weight of shipments that weren't late is the same as the mean weight of shipments that were late.
\(H_{A}\): The mean weight of shipments that weren't late is less than the mean weight of shipments that were late.
The test statistic, t_stat, is available, as are the samples sizes for each group, n_no and n_yes. Use a significance level of alpha = 0.05.
This exercise is part of the course
Hypothesis Testing in R
Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
Start Exercise