두 표본에 대한 proportions_ztest()
p-값을 계산하는 데 꽤 많은 노력이 들었죠. 계산 과정을 이해하는 건 유익하지만, 실제 분석에서 매번 그렇게 하는 건 실용적이지 않아요. 일상적인 사용에서는 statsmodels 패키지를 사용하는 편이 좋습니다.
가설을 다시 확인해 볼게요.
\(H_{0}\): \(late_{\text{expensive}} - late_{\text{reasonable}} = 0\)
\(H_{A}\): \(late_{\text{expensive}} - late_{\text{reasonable}} > 0\)
late_shipments 데이터프레임이 있으며, freight_cost_group 열을 포함하고 있습니다. numpy와 pandas는 표준 별칭으로 불러왔고, statsmodels.stats.proportion에서 proportions_ztest도 불러온 상태입니다.
이 연습은 강의의 일부입니다
Python으로 배우는 가설 검정
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Count the late column values for each freight_cost_group
late_by_freight_cost_group = ____
# Print the counts
print(late_by_freight_cost_group)