신뢰 구간 계산하기
신뢰 구간을 계산하는 두 가지 방법, 즉 분위수 방법(quantile method)과 표준 오차 방법(standard error method)을 배웠습니다. 표준 오차 방법은 정규분포의 누적분포함수의 역함수(inverse CDF)를 사용해 신뢰 구간을 계산하는 방법입니다. 이번 연습에서는 이 두 방법을 Spotify 데이터에 적용해 보겠습니다.
spotify_population, spotify_sample, bootstrap_distribution을 사용할 수 있고, pandas와 numpy는 일반적인 별칭으로 불러와져 있습니다. 또한 scipy.stats에서 norm이 로드되어 있습니다.
이 연습은 강의의 일부입니다
Python으로 살펴보는 표본추출(Sampling)
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Generate a 95% confidence interval using the quantile method
lower_quant = ____
upper_quant = ____
# Print quantile method confidence interval
print((lower_quant, upper_quant))