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
.
This exercise is part of the course
Sampling in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Generate a 95% confidence interval using the quantile method
lower_quant = ____
upper_quant = ____
# Print quantile method confidence interval
print((lower_quant, upper_quant))