표본분포 vs. 부트스트랩 분포
표본분포와 부트스트랩 분포는 밀접하게 연결되어 있어요. 모집단에서 반복적으로 표본추출을 할 수 있는 상황(매우 드뭅니다)에서는, 두 개념을 함께 학습할 때 표본분포와 부트스트랩 분포를 차례로 생성해 보면서 서로 어떤 관련이 있는지 확인하면 도움이 됩니다.
여기서 관심 있는 통계량은 노래들의 popularity 점수 평균입니다.
전체 데이터셋인 spotify_population과 원래 표본을 나타내는 500행만 포함한 spotify_sample이 준비되어 있고, dplyr가 로드되어 있습니다.
이 연습은 강의의 일부입니다
R에서의 표본추출
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Generate a sampling distribution
mean_popularity_2000_samp <- ___(
# Use 2000 replicates
___,
expr = {
# Start with the population
___ %>%
# Sample 500 rows without replacement
___ %>%
# Calculate the mean popularity as mean_popularity
___ %>%
# Pull out the mean popularity
___
}
)
# See the result
mean_popularity_2000_samp