Carrying Out a Two-Way Chi-Square Test
Introducido
7:48
Inferencia para Datos Categóricos: Chi-Cuadrado
Lanza un dado justo sesenta veces. Cada cara debería salir diez veces. Pero nunca sucede — ocho aquí, trece allá. Las brechas siempre están ahí. Así que lanza otro…
Narración en inglés · subtítulos en inglés y 中文 que puedes cambiar
En esta lección
| English | Significado |
|---|---|
| independent random samples | |
| chi-square test for a two-way table | |
| variable/ˈveərɪəbl/ | A characteristic recorded for each individual, such as height or eye colour. |
| test for homogeneity/test fɔː ˈhɒməʊdʒneɪti/ | A chi-square test of whether several populations share one distribution. |
| distribution/ˌdɪstrɪˈbjuːʃn/ | The pattern of values or outcomes and their frequencies or probabilities. |
| population/ˌpɒpjʊˈleɪʃn/ | The entire set of individuals, items or outcomes about which a statistical study seeks information. |
| test for independence/test fɔː ˌɪndɪˈpendəns/ | A chi-square test of whether two variables are associated in one population. |
| association/əˌsəʊsɪˈeɪʃn/ | A relationship between two variables. |
| expected counts/ekˈspektɪd kaʊnts/ | |
| hypotheses | |
| Large counts | |
| cells/selz/ | |
| p-value/piː ˈvæljuː/ | |
| categories | |
| right-tail area |
Calcule la estadística
- La estadística de chi-cuadrado es la misma suma sobre cada celda de la tabla:
-
$$\chi^2 = \sum \frac{(\text{observed} - \text{expected})^2}{\text{expected}}$$
- Utilice el conteo observado y el conteo esperado de cada celda según 8.4.
- Sume todos los términos de las celdas en un solo $\chi^2$.

Encuentra el valor-p
- Use la distribución chi-cuadrado con $df = (\text{rows}-1)(\text{columns}-1)$.
- El valor-p es el área de la cola derecha más allá de su $\chi^2$.
- Un $\chi^2$ grande → valor-p pequeño → fuerte evidencia en contra de $H_0$.
- Obtenga el correcto $df$ de la forma de la tabla, no del tamaño de la muestra.

Distribución chi-cuadrado: el valor p es la cola derecha más allá del estadístico de prueba
A school surveys one random sample of 300 students and records each student's year group and favourite sport. Which test fits?
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
One sample with two categorical variables per student → independence. Separate samples from each year group would be homogeneity.
Esta tarjeta se corrigió, por eso aparece en inglés hasta que se actualice su traducción.
Worked test: State and Plan
State. $H_0$: the distribution of main news source is the same for adults under 40 and adults aged 40 or older in this city. $H_a$: the distributions differ. $\alpha=0.05$.
Plan. Chi-square test for homogeneity.
- Random: independent random samples from each age group.
- 10%: Assume each age group in the city has at least 1,000 adults, so 100 is no more than 10% of each group.
- Large counts 大频数条件: expected count $=\dfrac{\text{row total}\times\text{column total}}{\text{table total}}$. Each row total is 100, so the expected counts are $\frac{100\times60}{200}=30$, $\frac{100\times115}{200}=57.5$, $\frac{100\times25}{200}=12.5$ in each row; all at least 5.
In a two-way table with total 400, a row total is 160 and a column total is 90. Find the expected count for that cell.
Dificultad 2/5 · 140 monedas + un pequeño bono en el primer intento de hoy
(row total × column total) ÷ table total = 160 × 90 ÷ 400 = 36.
Concluir en contexto
- Para homogeneidad: "hay evidencia convincente de que las distribuciones difieren entre los grupos" (si se rechaza).
- Para independencia: "hay evidencia convincente de que las dos variables están asociadas" (si se rechaza).
- Nombre las variables/grupos y el contexto real.
- No rechazar nunca prueba que los grupos sean iguales / las variables independientes.
With χ² = 6.0 at df = 1, the p-value ≈ 0.014. At α = 0.05, the decision is...
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
0.014 ≤ 0.05 → reject H0.
The p-value for a two-way chi-square test is a right-tail area.
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
Chi-square is always right-tailed.
For a 3×4 two-way table, find the degrees of freedom (r−1)(c−1).
Dificultad 2/5 · 140 monedas + un pequeño bono en el primer intento de hoy
(3−1)(4−1) = 2×3 = 6.
Redacte la conclusión para que coincida con la prueba. Rechazar en una prueba de homogeneidad → las distribuciones de los grupos difieren; rechazar en una prueba de independencia → las variables están asociadas. No diga "las variables están relacionadas" para un diseño de homogeneidad, ni "los grupos difieren" para un diseño de independencia — las matemáticas son compartidas pero la afirmación no lo es.
In the news-source test, which statement best describes the difference between the age groups?
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
The TV cells give the largest terms (3.33 each). Observational data show a difference, not a cause.
Una prueba de $2\times2$ da $\chi^2 = 6.0$, $df = 1$, $\alpha = 0.05$.
- Valor-p: área de cola derecha más allá de $6.0$ en $df=1 \approx 0.014$.
- Decisión: $0.014 \le 0.05$ → rechace $H_0$.
- Conclusión: evidencia convincente de que las dos variables están asociadas (en contexto).
Rejecting H0 in a test of INDEPENDENCE means...
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
Independence: reject → the variables are associated.
Rejecting H0 in a test of HOMOGENEITY means...
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
Homogeneity: reject → the group distributions differ.
A chi-square test for independence of "owns a pet" and "exercises daily" in a random sample of adults gives p = 0.31 (α = 0.05). Write the conclusion.
A large p-value means weak evidence, not proof of independence.
Calcule $\chi^2 = \sum \frac{(\text{observed}-\text{expected})^2}{\text{expected}}$ sobre todas las celdas, encuentre el valor-p de cola derecha en $df = (\text{rows}-1)(\text{columns}-1)$, y compárelo con $\alpha$. Redacte la conclusión para que coincida con el diseño: distribuciones difieren (homogeneidad) o variables asociadas (independencia), en contexto.
Escribir desde 4 grados de libertad
- Una prueba chi-cuadrado utiliza una tabla de 3 por 3.
- El estadístico de la lección 6 es un valor chi-cuadrado calculado, no los grados de libertad de esta tabla.
Esta tarjeta es nueva, por eso aparece en inglés hasta que su traducción esté lista.
- The design decides the test, not the table. The same table could come from one sample (independence) or several samples (homogeneity).
- df uses rows and columns of categories 类别, not the totals row or column: a $2\times3$ table has $df=2$.
- Expected counts are usually not whole numbers (57.5 is fine). Never round them to make the check pass.
Esta tarjeta es nueva, por eso aparece en inglés hasta que su traducción esté lista.
A two-way chi-square test compares observed and expected counts in every cell: $\chi^2=\sum\frac{(\text{O}-\text{E})^2}{\text{E}}$, with $\text{E}=\frac{\text{row total}\times\text{column total}}{\text{table total}}$ and $df=(r-1)(c-1)$; the p-value is the right-tail area 右尾面积. Several samples → homogeneity (distributions differ?); one sample, two variables → independence (association?). Conclude in context and use the largest terms to say where the difference lies.
¿Qué salió mal? Solo el equipo del sitio ve esta información.