stats.chi_square_independence
Test whether two categorical variables in a contingency table are independent using a chi-square test; returns chi-square statistic, degrees of freedom, p-value, and expected frequencies.
Instructions
분할표의 두 범주형 변수가 독립인지 카이제곱 검정으로 판정해 chi2, df, p_value, 기대빈도 표를 돌려준다. observed는 관측 빈도의 2x2 이상 Decimal 문자열 행렬이다. scipy 기본값에 따라 2x2 표에는 Yates 연속성 보정이 적용된다. 결과는 유효숫자 10자리 문자열이다. 비율 자료나 기대빈도가 5 미만인 칸이 많은 표에는 부적합하다.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| observed | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| df | Yes | ||
| chi2 | Yes | ||
| _meta | No | 서버가 붙이는 영수증(integrity), 엔진, 힌트 | |
| trace | Yes | 계산 근거(tool, formula, inputs, steps, output) | |
| p_value | Yes | ||
| expected | Yes |