Performing a goodness of fit test
The bar plot of vendor_inco_term suggests that the distribution across the four categories was quite close to the hypothesized distribution. You'll need to perform a chi-square goodness of fit test to see whether the differences are statistically significant.
Recall the hypotheses for this type of test:
\(H_{0}\): The sample matches with the hypothesized distribution.
\(H_{A}\): The sample does not match with the hypothesized distribution.
To decide which hypothesis to choose, we'll set a significance level of 0.1.
late_shipments, incoterm_counts, and hypothesized from the last exercise are available. chisquare from scipy.stats has been loaded.
Deze oefening maakt deel uit van de cursus
Hypothesis Testing in Python
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Perform a goodness of fit test on the incoterm counts n
gof_test = ____
# Print gof_test results
print(gof_test)