MulaiMulai sekarang secara gratis

Calculating a z-score

Since variables have arbitrary ranges and units, we need to standardize them. For example, a hypothesis test that gave different answers if the variables were in Euros instead of US dollars would be of little value. Standardization avoids that.

One standardized value of interest in a hypothesis test is called a z-score. To calculate it, you need three numbers: the sample statistic (point estimate), the hypothesized statistic, and the standard error of the statistic (estimated from the bootstrap distribution).

The sample statistic is available as late_prop_samp.

late_shipments_boot_distn is a bootstrap distribution of the proportion of late shipments, available as a list.

pandas and numpy are loaded with their usual aliases.

Latihan ini adalah bagian dari kursus

Hypothesis Testing in Python

Lihat Kursus

Petunjuk latihan

  • Hypothesize that the proportion of late shipments is 6%.
  • Calculate the standard error from the standard deviation of the bootstrap distribution.
  • Calculate the z-score.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Hypothesize that the proportion is 6%
late_prop_hyp = ____

# Calculate the standard error
std_error = ____

# Find z-score of late_prop_samp
z_score = ____

# Print z_score
print(z_score)
Edit dan Jalankan Kode