Calculating a z-score
Since variables have arbitrary ranges and units, we need to standardize them. For example, it would be silly if a hypothesis test gave a different answer if your variables were in Euros instead of US dollars. Standardization avoids that.
One standardized value of interest in a hypothesis test is called a z-score. To calculate it, we need three numbers: the sample statistic (point estimate), the hypothesized statistic, and the standard error of the statistic (which we estimate from the bootstrap distribution).
The sample statistic is late_prop_samp
.
late_shipments_boot_distn
is a bootstrap distribution of the proportion of late shipments. The proportion of late shipments statistic is in the late_prop
column.
late_prop_samp
and late_shipments_boot_distn
are available; dplyr
is loaded.
This exercise is part of the course
Hypothesis Testing in R
Exercise instructions
- Hypothesize that the proportion of late shipments is 6%.
- Calculate the standard error. That is, the standard deviation of the bootstrap distribution.
- Calculate the z-score.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Hypothesize that the proportion is 6%
late_prop_hyp <- ___
# Calculate the standard error
std_error <- ___
# Find z-score of late_prop_samp
z_score <- ___
# See the results
z_score