BaşlayınÜcretsiz Başlayın

Test for single proportions

In Chapter 1, you calculated a p-value for a test hypothesizing that the proportion of late shipments was greater than 6%. In that chapter, you used a bootstrap distribution to estimate the standard error of the statistic. An alternative is to use an equation for the standard error based on the sample proportion, hypothesized proportion, and sample size.

\(z = \dfrac{\hat{p} - p_{0}}{\sqrt{\dfrac{p_{0}*(1-p_{0})}{n}}}\)

You'll revisit the p-value using this simpler calculation.

late_shipments is available. pandas and numpy are available under their usual aliases, and norm is loaded from scipy.stats.

Bu egzersiz

Hypothesis Testing in Python

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Hypothesize that the proportion of late shipments is 6%
p_0 = ____

# Calculate the sample proportion of late shipments
p_hat = ____

# Calculate the sample size
n = ____

# Print p_hat and n
print(p_hat, n)
Kodu Düzenle ve Çalıştır