MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Hypothesis Testing in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Perform a goodness of fit test on the incoterm counts n
gof_test = ____


# Print gof_test results
print(gof_test)
Edit dan Jalankan Kode