Atlas
statminds
Categorical GLM (Contingency Model)The underlying model family class (e.g. GLM, linear model, categorical matrix, log-linear).Parametric ReferenceStatistical methods that assume a specific probability distribution family (typically normal).12-stage workflow

Chi-Square Independence

The engine for Categorical Discovery. This model audits the non-random association between two nominal variables, revealing the hidden 'Shared Destiny' between categories in a contingency grid.

Model familyCategorical GLM (Contingency Model)
Hypothesisomnibus
AliasesPearson Chi-Square Test · Contingency Table Test · Categorical Association Audit
G1
Association Audit
Determine if the distribution of one categorical variable significantly depends on the level of another.
G2
Contingency Mapping
Identify the specific 'Hotspots' in a cross-tabulation where observed counts deviate most from random expectation.
G3
Non-Random Synergy
Isolate the unique relationship between discrete attributes (e.g., Treatment Group vs. Success Status).
1

What is it?

Chi-Square Test of Independence determines whether two nominal variables are statistically associated with one another in a population.

2

When to use it

  • Two Categorical Variables: e.g. Gender (Male/Female) vs. Preference (Product A/Product B).
  • Independent Subjects: Unrelated participants grouped in a contingency table.
3

Core Idea

We calculate what frequency count would be expected in each cell under the null hypothesis of independence:

Expected = (Row Total * Column Total) / Grand Total

If the observed frequencies diverge significantly from expected counts, we conclude that the two categories are related.

4

Hypotheses

H0: The two variables are independent (no association).
Ha: The two variables are dependent (associated).
5

How it works

  1. Construct contingency table and calculate row/column sums.
  2. Calculate expected value E for every cell.
  3. Compute cell residuals: (O - E)^2 / E.
  4. Sum cells to get X2. Degrees of freedom = (rows-1)*(cols-1) = 1.
6

Assumptions

📊 Cell Count: Expected counts in all cells should be >= 5.
👤 Independent Counts: No participant represents multiple cells.
7

Effect Size

Measured via Cramér's V. For a 2x2 table, Cramér's V is equivalent to the Phi coefficient. Values of 0.1, 0.3, and 0.5 indicate weak, moderate, and strong associations.

8

Quick Example

FactorCol 1Col 2
Row 14218
Row 21545
Interactive Sandbox

Independence Live Laboratory

Vary the four cells of a 2x2 contingency table to watch the Pearson residual color shift and X2 changes.

Cell A (R1 C1)42
Cell B (R1 C2)18
Cell C (R2 C1)15
Cell D (R2 C2)45
Mosaic Plot representing 2x2 countsCell color indicates standardized Pearson residuals (Blue = Positive, Red = Negative)
A=42B=18C=15D=45Row 1Row 2Col 1Col 2
Calculations Output
MetricValue
Total Sample Size (N)120
Chi-Square Statistic (X2)24.3609
Degrees of Freedom (df)1
Cramér's V (Effect Size)0.4506
p-value0.0000
Association Summary

Significant Association There is a statistically significant association between the two factors (p = 0.0000). We reject the hypothesis of independence.

The 12-Stage Precision Workflow
01Statistical Independence
Hypotheses
We test the Null (no association) against the discovery of a systematic, non-random clustering across categories.
02Expected Frequencies
Assumptions
The 'Cochran Mandate': Ensuring at least 80% of cells have expected counts ≥ 5—the foundational prerequisite for Chi-Square integrity.
03Sparsity Forensics
Diagnostics
Auditing the grid for 'Zero-Cells' or ultra-low counts that threaten to collapse the p-value calculation.
04focus
Testing the association between FlowMotion Participation (Yes/No) and Responder Status (Full/Partial/None).
05Fisher-Exact Pivot
Alternatives
Knowing when to switch to Fisher's Exact Test if the grid is small (2x2) and the cell counts are dangerously sparse.
06The χ² Strike
Significance
Calculating the cumulative distance between what we saw and what random chance predicted—the definitive χ² statistic.
07Cramer's V / Phi
Effect Size
Converting the cold p-value into a standardized metric of association strength—revealing the 'Weight' of the categorical bond.
08Grid Saturation
Sample Size
Determining the N required to ensure that even rare categorical outcomes have enough data to be statistically visible.
09The χ² Statement
Reporting
Reporting the result clearly: 'χ²(df, N = XXX) = X.XX, p = .XXX, V = .XX'.
10Cross-Tab Logic
Software
Executing 'chisq.test' or 'crosstab' commands, ensuring the algorithm uses the correct dimension-adjustment for the grid.
11focus
The fatal error of reporting row percentages without auditing the 'Expected Counts'—leading to false signals from small samples.
12focus
Tracing the model back to Karl Pearson (1900) and the foundational evolution of goodness-of-fit and contingency forensics.
01Hypothesis test logic

Hypotheses

Pragmatic null and alternative hypotheses defined in mathematical notation.

A hypothesis is a question sharpened to a point. Ambiguity is the enemy of inference.
Logic Core
Null · H₀

H₀: The two variables are independent (no association)

Alternative · Hₐ

Hₐ: The two variables are associated (dependent)

Why it matters omnibus

Tests whether row and column variables in a contingency table are statistically independent. Uses chi-square distribution with (r-1)(c-1) df where r=rows, c=columns.

02Model diagnostics

Assumptions

The core mathematical criteria needed to ensure that statistical testing remains unbiased and valid.

Build your analysis on rock, not sand. Verify the mathematical foundation before building the model.
Integrity Shield
6
Assumptions
0
Critical / High Severity
How to check
Quick
Review study design: ensure each participant/unit appears once in table. Check that sample size equals total frequency in table. Verify no hierarchical structure (e.g., students nested in schools).
Rigorous
Calculate intraclass correlation (ICC) if clustering suspected. Examine residual plots for patterns suggesting dependence. Use Durbin-Watson test for time-ordered data.
If violated
Restructure data to one row per independent unit. For clustered data, aggregate to cluster level or use cluster-robust standard errors. Alternatives: McNemar's test for matched pairs, Cochran-Mantel-Haenszel test for stratified tables, mixed-effects logistic regression for nested data, GEE for correlated observations.
mcnemarlogistic regressiongeemantel haenszel trend
How to check
Quick
Calculate expected frequencies: E_ij = (n_i× × n_×j) / n. Count cells with E_ij < 5. Calculate percentage: (cells < 5) / total_cells × 100.
Rigorous
Simulate Type I error rate via Monte Carlo under independence assumption with actual margins. Generate 10,000 tables, test each, check if rejection rate ≈ α. Use exact test if simulation shows inflation.
If violated
Combine adjacent rows or columns based on substantive similarity (e.g., merge 'rarely' and 'never'). Increase sample size if feasible. Use continuity correction (Yates) for 2×2 tables. Alternatives: Fisher's exact test (especially for 2×2 tables or small samples), G-test which performs slightly better with small frequencies, permutation test, Barnard's exact test (more powerful than Fisher for 2×2).
fisher exact
How to check
Quick
Verify sum of all cell frequencies equals total sample size. Check for 'Other' category that may hide important groups. Ensure category definitions are unambiguous.
Rigorous
Cross-validate classifications: have independent raters code subset of cases, calculate Cohen's kappa for agreement. Review raw data for edge cases or missing values.
If violated
Redefine categories to ensure mutual exclusivity. Create 'Mixed' or 'Other' category for ambiguous cases (but use sparingly as it reduces interpretability). Remove observations with missing data on either variable (document exclusions). Alternatives: Log-linear models can handle overlapping categories via partial association models. Latent class analysis for complex categorical structures.
How to check
Quick
Document sampling method. Compare sample demographics to known population parameters. Check for obvious selection biases (e.g., online survey skewing young).
Rigorous
Calculate sampling weights if stratified design used. Conduct sensitivity analysis comparing weighted vs. unweighted results. Test for response bias by comparing early vs. late responders.
If violated
Apply post-stratification weights to adjust sample to population margins. Use raking or iterative proportional fitting to match multiple marginals simultaneously. Alternatives: Propensity score weighting to adjust for selection bias. Multilevel models if sampling frame has hierarchical structure. Report results as exploratory/hypothesis-generating rather than confirmatory.
How to check
Quick
Calculate n/(r×c) ratio. For 2×2 table, aim for n ≥ 40-100. For 4×5 table, aim for n ≥ 200-400. Check if average cell count exceeds 10-20.
Rigorous
Conduct power analysis using G*Power or pwr package with expected effect size (Cramér's V). For post-hoc power: pwr.chisq.test(w=V, N=n, df=(r-1)*(c-1), sig.level=0.05).
If violated
Increase sample size, collapse categories to reduce table dimensions (e.g., combine 5-point scale to 3 categories), focus analysis on key comparisons rather than full table. Alternatives: Use exact tests for small samples, Bayesian methods with informative priors, or report findings as preliminary/exploratory with explicit power limitations.
How to check
Quick
Review study design: Were N individuals randomly sampled and classified on both variables (independence)? Or were fixed numbers sampled from each group (homogeneity)? If total N fixed, use independence framework.
Rigorous
Check sampling plan documentation. Independence test appropriate when sampling from single population. Homogeneity test appropriate when comparing distributions across predefined groups.
If violated
If one margin fixed by design (e.g., equal numbers of males/females sampled), reframe as test of homogeneity rather than independence. Hypothesis and interpretation change but test statistic identical. Alternatives: Log-linear models can accommodate various sampling schemes (Poisson, multinomial, product-multinomial). Conditional inference for stratified designs.
03Residual Forensics

Diagnostics

Checking residual plots and indices to examine model deviations and ensure standard error integrity.

Trust, but verify. The outliers often hold more truth than the averages.
System Health
Essential checks
  1. Calculate and examine all expected cell frequencies (must have ≥80% cells with E≥5)
  2. Compute standardized residuals: (O_ij - E_ij) / sqrt(E_ij) for each cell
  3. Verify marginal totals sum correctly and match overall sample size
  4. Check for sparse cells (E_ij < 5) and consider collapsing categories
  5. Examine which cells contribute most to chi-square statistic
Recommended checks
  1. Create mosaic plot to visualize association pattern and residuals
  2. Plot standardized (Pearson) or adjusted residuals (|r| > 2 indicates significance)
  3. Calculate and interpret Cramér's V with bootstrap confidence intervals
  4. Conduct post-hoc pairwise comparisons if overall test significant
  5. Create association plot showing deviations from independence
  6. Examine Pearson vs. adjusted (standardized Pearson) residuals for outlier cells
  7. Test for Simpson's paradox if covariates present
  8. Compare with Fisher's exact test for 2×2 tables as sensitivity check
  9. Create contingency coefficient and phi coefficient (for 2×2 tables)
  10. Assess potential confounders via stratified analysis (CMH test)
04Live Instances

Applied Minds

Review concrete study examples, data layout guidelines, and copy executable syntax scripts.

Theory is the map. Practice is the terrain. Simulation bridges the gap.
Applied Wisdom
Example 01

2×3 Contingency Table

Survey of 500 registered voters examining association between gender (Male/Female) and political party preference (Democrat/Republican/Independent). Includes comprehensive diagnostics, mosaic plots, standardized residuals, effect sizes with bootstrap CIs, and post-hoc analysis of individual cells.

05Tactical Pivots

Alternatives

Structured fallback pathways for choosing alternative tests when normality or slopes requirements fail.

When the path is blocked, pivot. Rigor is not rigidity; it is the intelligent adaptation to reality.
Adaptive Strategy
Measurement Precision Ladder Ideal · Nominal Grid
Ratio / Interval
Consider Pearson r or OLS. Categorical conversion of continuous scales destroys the predictive pulse.
Information Suicide
Ordinal
Pivot to Kendall's Tau-B or Gamma to preserve the natural ordering of your categories.
Rank Compression
Nominal
Maintain Chi-Square logic. The definitive engine for auditing non-random clustering in categorical grids.
Peak Signal
Binary
Maintain logic. For 2x2 grids, the Phi Coefficient provides the most intuitive effect size.
Standard Precision
Temporal Trajectory Audit Static Categorical Snapshot
Static Grid
Single point audit.
Stay with Chi-Square Independence. Map the drivers of non-random group association.
Matched Pairs
Trajectory flips.
Pivot to McNemar's Test to model the probability of categorical status-change over time.
Adaptive Technical Safeguards · adaptive safeguards
sparsity detected
  • Fisher's Exact Test — Mandatory pivot for 2x2 grids when expected counts are < 5.
  • Monte Carlo Chi-Square — Resample the null distribution to protect significance in larger sparse grids.
non independent samples
  • Log-Linear Analysis — Audit the hierarchy of associations in multi-way tables.
  • Categorical GEE — Account for subject-level clustering across categorical clusters.
ordered categories
  • Cochran-Armitage Trend Test — Exploit the rank-order to increase trend-detection power.
06Adjusted Comparisons

Post-hoc

Group mean comparisons and correction controls (e.g. Tukey HSD, Bonferroni) to protect against Family-Wise Error Rates.

The omnibus test opens the door; post-hoc analysis explores the room.
Forensic Detail
Adjusted Comparisons

Post-hoc pairwise tests defined for this model.


Correction methods
Standardized residuals: |residual| > 2 indicates p < .05 for that cellAdjusted residuals: account for marginal totals, preferred over Pearson residualsPairwise chi-square tests with Bonferroni correction (k comparisons, use α/k)Post-hoc Fisher's exact tests for 2×2 subtablesPartition chi-square into meaningful components (e.g., trend + deviation)
Interpretation Guidelines

No specific guidelines provided.

07Standardized scale impact

Effect Size

Understanding effect sizes (e.g., Cohen's d, Partial Eta-Squared) and clinical impact benchmarks.

Significance is noise. Magnitude is the signal. Measure the impact, not just the probability.
Impact Magnitude
formula

V = sqrt(χ² / (n × min(r-1, c-1)))

interpretation df1

{"small":0.07,"medium":0.21,"large":0.35,"note":"For df_min = 1 (e.g., 2×2, 2×k, r×2 tables)"}

interpretation df2

{"small":0.06,"medium":0.17,"large":0.29,"note":"For df_min = 2 (e.g., 3×3, 3×k tables)"}

interpretation df3

{"small":0.05,"medium":0.15,"large":0.25,"note":"For df_min = 3 (e.g., 4×4, 4×k tables)"}

note

Standardized measure ranging 0-1; adjusts for table dimensions. Use bootstrap for confidence intervals.

confidence intervals

Bootstrap resampling (1000-2000 iterations) for 95% CI

formula

φ = sqrt(χ² / n)

range

For 2×2 tables: -1 to +1; for larger tables: 0 to sqrt(min(r,c)-1)

interpretation 2x2

{"small":0.1,"medium":0.3,"large":0.5}

note

Equivalent to Pearson correlation for 2×2 table dichotomized variables. For r×c tables, use Cramér's V instead.

formula

OR = (a×d) / (b×c) for 2×2 table [[a,b],[c,d]]

interpretation

OR = 1 (no association), OR > 1 (positive association), OR < 1 (negative association)

note

Only for 2×2 tables. Report with 95% CI. Use log(OR) for symmetric confidence intervals.

confidence interval

95% CI: exp(log(OR) ± 1.96 × SE), where SE = sqrt(1/a + 1/b + 1/c + 1/d)

Recommended Metric: Cramér's V with bootstrap 95% CI for all table dimensions
Small
0.2
Medium
0.5
Large
0.8
0.50
Cramér's V with bootstrap 95% CI for all table dimensions
Recommended Measure
4
Available Metrics
ReportUse Cramér's V with bootstrap 95% CI for all table dimensions to represent clinical impact magnitude.
08Statistical Power

Sample Size

Guidelines for minimum sample requirements and power analysis parameters.

An underpowered study is an ethical failure. Respect the data by collecting enough of it.
Power Protocol
Floor Requirements

The 'Cochran Mandate': A minimum total N of 40 is recommended for a 2x2 table. Every cell in the grid MUST have an expected count ≥ 5 to maintain the integrity of the Chi-Square approximation.

Effect SizeParametersRequired n
Small Effectw=0.10 (Small)n ≈ 785
Medium Effectw=0.30 (Medium)n ≈ 88
Large Effectw=0.50 (Large)n ≈ 32
Key considerations

Sparsity Strike: In tables larger than 2x2, 'Zero-Cells' are the silent killers of power. If cell counts are sparse, the Chi-Square p-value becomes a mathematical phantom. Pivot to Fisher's Exact or use bootstrapping.

G*Power StrategyBenchmark: χ² tests → Goodness-of-fit: Contingency tables. Parameters: Effect size w, α = .05, Power = .80, df = 1 (for 2x2). The 'Grid Penalty': Power drops as the table dimensions (Rows x Columns) increase.
09APA narrative blueprint

Reporting

How to compile statistical results into publication prose matching APA and journal style guides.

Data does not speak for itself. It requires a translator. Be clear, be precise, be honest.
Narrative Arc
Worked APA paragraph example
A chi-square test of independence was performed to examine the relationship between gender and political party affiliation among registered voters (N = 500). All expected cell frequencies exceeded 5, satisfying assumptions for valid chi-square approximation. The analysis revealed a small but significant association between gender and party preference, χ²(2, N = 500) = 4.21, p = .122, Cramér's V = .092, 95% CI [.015, .181]. However, examination of adjusted standardized residuals showed no individual cells with significant deviations (all |residuals| < 2), suggesting the association, while statistically detectable, is of minimal practical importance. Among males, 38.8% identified as Democrat, 34.7% Republican, and 26.5% Independent. Among females, the distribution was 33.3% Democrat, 31.4% Republican, and 35.3% Independent. Bootstrap analysis (1500 iterations) confirmed the small effect size with narrow confidence intervals.
Reusable template

A chi-square test of independence was conducted to examine the association between Variable 1 and Variable 2. The test revealed a significant association, χ²(df, N = n) = X.XX, p = .XXX, Cramér's V = .XX, 95% CI .XX, .XX. Examination of standardized residuals indicated that specific cells were significantly over/under-represented.

10Exhibit Builder

Manuscript Lab

Copy standard summary tables and forensic reporting grids to outline analysis details.

Table 1: Chi-Square Test of Independence for Employment Status by Gender
GroupEmployedUnemployedχ²dfpCramer's V
Male180 (45%)20 (5%)12.451< .001.18
Female150 (37.5%)50 (12.5%)
Note. N = 400. Pearson Chi-Square used. All expected counts > 5.
χ² (12.45)Powerful Category Pulse. The gender-employment distribution is significantly different from random allocation.
p < .001Identifies Structural Disparity. The probability of this distribution occurring by chance is nearly zero.
Header glossary

The Frequency Gap. Measures the squared difference between what we observed and what we expected by chance.

The Category Link. Measures the strength of association. .18 is a 'Small-to-Moderate' link.

11Algorithmic Logic

Command Center

Syntax libraries and function parameters for executing calculations in stats packages.

Code is the modern laboratory. Clean execution ensures reproducible discovery.
Execution Engine
# 1. Execute Chi-Square Test
results <- chisq.test(table(df$gender, df$status))
print(results)

# 2. Extract Cramer's V
lsr::cramersV(table(df$gender, df$status))
Library stack
R
statsvcdlsr
Python
scipy.stats
Elite Forensic Strike

The 'Sample Size Trap'. If any expected cell count is < 5, the Chi-Square p-value is invalid. You MUST pivot to Fisher's Exact Test.

# Audit Cell Assumptions
chisq.test(table_data)$expected
12The Over-adjustment Trap

Common Mistakes

Analytical caveats and corrections to maintain modeling integrity.

Wisdom is learning from the failures of others. Anticipate the error before it occurs.
Defensive Logic
Why it's wrong
While the test statistic and formula are identical, the sampling schemes and interpretations differ. Independence test: sample N individuals, classify on two variables (both margins random). Homogeneity test: sample fixed numbers from different groups, compare distributions (one margin fixed). Using the wrong framework leads to incorrect inference about what the test shows.
The correction
Clarify study design: Did you sample from one population and measure two characteristics (independence)? Or did you sample from multiple predefined groups and compare distributions (homogeneity)? Independence asks: 'Are X and Y associated?' Homogeneity asks: 'Do groups A, B, C have the same distribution on Y?' Report test name matching design. Example: 'A chi-square test of homogeneity compared party affiliation distributions across three age groups (n₁=150, n₂=175, n₃=175).'
Why it's wrong
Chi-square approximation breaks down when expected frequencies are small. With E < 5 in many cells, Type I error rate can inflate to 10-15% (vs. nominal 5%). Analysts often blindly trust software output without verifying expected frequencies, especially in larger tables where visual inspection is harder.
The correction
Always examine expected frequencies: exp_freq = (row_total × col_total) / grand_total for each cell. Count cells with E < 5 and calculate percentage. If >20% of cells violate assumption, combine adjacent categories (e.g., merge 'rarely' + 'never'), increase sample size, or use Fisher's exact test (2×2) or permutation test (larger tables). Report: 'All expected frequencies exceeded 5 (range: 12.3-98.7), satisfying chi-square assumptions.'
Why it's wrong
Significant omnibus test (p < .05) only tells you some association exists, not where or why. Failing to examine residuals is like doing ANOVA without post-hoc tests—you know groups differ but not which ones. Residuals identify specific cells driving the association (e.g., 'Females over-represented among Independents'), providing substantive insight.
The correction
Always calculate adjusted standardized residuals: (O-E)/sqrt(E×(1-p_row)×(1-p_col)). Values >2 or <-2 indicate significant cell deviations. Create heatmap or table of residuals. Report: 'Adjusted residuals revealed significant over-representation of females among Independents (residual=2.8, p<.01) and under-representation among Republicans (residual=-2.1, p<.05).' Consider mosaic plots with residual shading for visualization.
Why it's wrong
For small n (e.g., n < 40 for 2×2 table, n < 100 for 3×3), chi-square approximation is unreliable even if expected frequencies barely meet the E ≥ 5 threshold. P-values can be inaccurate by factors of 2-3, leading to Type I or Type II errors. Fisher's exact test is often computationally feasible and provides exact p-values.
The correction
For 2×2 tables with small n, always use Fisher's exact test as primary analysis and report chi-square as sensitivity check. In R: fisher.test(table). In Python: scipy.stats.fisher_exact(). For larger tables, use Monte Carlo simulation: chisq.test(table, simulate.p.value=TRUE, B=10000). Report: 'Fisher's exact test: p = .032 (two-tailed); chi-square test: χ²(1)=4.51, p=.034. Results converge, supporting association.'
Why it's wrong
With large samples, even trivial associations become 'significant' (e.g., V=0.05, p=.001 with n=5000). P-value indicates whether effect is distinguishable from zero, not whether it's meaningful. Cramér's V of 0.08 might be significant but represents <1% of variance explained (V²), which is negligible for practical purposes.
The correction
Always report Cramér's V with bootstrap 95% CI alongside p-value. Interpret effect size using Cohen's benchmarks (adjusted for df): small/medium/large. Report: 'Although statistically significant, χ²(2)=12.5, p=.002, the association was small (V=.08, 95% CI [.04, .13]), accounting for less than 1% of variance (V²=.006).' For 2×2 tables, also report odds ratio with CI for more interpretable effect size.
Why it's wrong
Association direction can reverse when aggregating across strata. Example: Overall, treatment appears worse than control (χ²=8.2, p=.004). But when stratified by disease severity (mild/moderate/severe), treatment is better in each stratum. The overall association is confounded by severity distribution. Ignoring stratification variables leads to incorrect conclusions.
The correction
If potential confounders exist (e.g., age, region, time period), conduct Cochran-Mantel-Haenszel test to test association while controlling for stratification. In R: mantelhaen.test(array). Compare crude vs. adjusted estimates. Check for effect modification (interaction): does association vary across strata? Report: 'Crude analysis suggested negative association (OR=0.65, p=.032), but CMH test controlling for disease severity showed positive association (OR_MH=1.45, p=.018, Breslow-Day p=.68), indicating Simpson's paradox.'
Why it's wrong
Researcher degrees of freedom: trying multiple ways to collapse categories until p < .05 inflates Type I error. Example: testing original 4×5 table (p=.12), then combining columns to 4×3 (p=.08), then 4×2 (p=.04). This is p-hacking. Each test should be pre-specified based on theory.
The correction
Pre-specify category structure based on theory or prior research before analysis. If collapsing is necessary due to sparse cells, do so based on substantive similarity (not statistical convenience) and document decision. Better: report results for multiple pre-specified structures with family-wise error correction (Bonferroni). State: 'Categories were collapsed from 5 to 3 levels based on prior literature [cite] before examining data. Sensitivity analysis with original 5-level structure yielded similar results.'
Why it's wrong
Standard chi-square treats categories as nominal, ignoring ordinal information. This loses power to detect monotonic trends. Example: testing education (less than HS, HS, some college, bachelor's, graduate) × income has df=12. But primary interest is often linear trend (income increases with education), which is df=1. Omnibus test dilutes power across all possible associations.
The correction
For ordered variables, partition chi-square into linear trend component (df=1) and departure from linearity (df=remaining). Use Cochran-Armitage test for trend in proportions: prop.trend.test() in R or statsmodels.stats.proportion.proportions_chisquare() in Python. Report: 'Linear trend test showed significant positive association between education and high income (χ²_trend(1)=24.5, p<.001), with no significant departure from linearity (χ²_departure(11)=8.3, p=.69).' This tests specific hypothesis with greater power.
13Academic Lineage

References

Scholarly lineage and citation keys grounding the statistical framework.

We stand on the shoulders of giants. Honor the source of the method.
Academic Lineage
[1]
[2]
[3]
[4]
[5]
[6]
In a categorical world, everything is either a pattern or a coincidence. Use the Chi-Square to measure the weight of the pattern, but never mistake association for absolute truth.
The Interpretive Rigor Directive
statminds · Chi-SquareMind reference · v2.2 · updated 2026-01-1715 of 15 sections