Aan de slagGa gratis aan de slag

Calculating confidence intervals

You have learned about two methods for calculating confidence intervals: the quantile method and the standard error method. The standard error method involves using the inverse cumulative distribution function (inverse CDF) of the normal distribution to calculate confidence intervals. In this exercise, you'll perform these two methods on the Spotify data.

spotify_population, spotify_sample, and bootstrap_distribution are available; pandas and numpy are loaded with their usual aliases, and norm has been loaded from scipy.stats.

Deze oefening maakt deel uit van de cursus

Sampling in Python

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Generate a 95% confidence interval using the quantile method
lower_quant = ____
upper_quant = ____

# Print quantile method confidence interval
print((lower_quant, upper_quant))
Code bewerken en uitvoeren