Chi-squared test of independence Created 2026-09-24 Updated 2026-11-05
For independent categorical observations cross-classified into an by contingency table, let be observed counts and let be their row and column totals. Under the null hypothesis of independence, fitted expected counts are , and the Pearson statistic is
With fixed and strictly positive underlying cell probabilities, its null distribution tends to as . The unrestricted cell-probability model has dimensions; the independence model has , giving that difference.
For counts , all fitted counts are , so with one degree of freedom. Sparse counts or structural zeros require different calibration or an appropriately specified exact procedure; the large-sample approximation is not a guarantee for every table.
Cramér's V 2026-10-25
For an contingency table with observations and positive row and column totals, Cramér's V rescales the Pearson chi-squared statistic to a dimensionless measure of statistical association. It lies between zero and one and is unchanged by reordering category labels. It therefore describes the magnitude of dependence, without an ordinal direction. A small p-value can accompany a small in a large sample: evidence against independence and the magnitude of the departure answer different questions. The displayed quantity is the usual uncorrected sample measure.
Expected frequency 2026-10-25
The expected value of the number of observations in a category under a specified statistical model. For observations with common category probability , linearity of expectation gives ; the calculation does not itself require independence. In a contingency table, fitting independence gives . These are model-based counts, which may be fractional, rather than an additional set of observed responses. Pearson's chi-squared test compares observed counts with their corresponding expected frequencies.
For a contingency table with Pearson chi-squared statistic and sample size , the nonnegative magnitude is sometimes reported as generalized phi. It does not encode an ordinal direction. In a two-row or two-column table it coincides with Cramér's V; in larger tables it can exceed one, so the normalization in Cramér's V matters. In a two-by-two table it is the absolute value of the Pearson correlation coefficient of binary category indicators; a signed binary phi requires a stated coding convention.
Predict categorical response by a most frequent category. Without knowing , the number of mistakes in a contingency table is . Allowing a separate most frequent response for each predictor row gives . Goodman and Kruskal's lambda is the fractional reduction in those mistakes when . Its direction matters, and it can vanish despite statistical association: if every row has the same most frequent response category, knowledge of changes no modal predictions even when the row distributions differ.
Independence log-linear model for a two-way contingency table Created 2026-09-29 Updated 2026-10-14
For cell counts in a two-way contingency table, the independence model is
The absence of an interaction makes factor as a row effect times a column effect. Its maximum-likelihood fitted values are
For independent strata, each containing an contingency table, test independence of the two table variables within every stratum. Under adequate expected counts and the usual multinomial distribution sampling assumptions, each stratum's Pearson chi-squared statistic has asymptotic chi-squared distribution with statistical degrees of freedom. Their sum has asymptotic chi-squared distribution with statistical degrees of freedom, by the additivity of independent chi-squared distributions. This is a test of conditional independence, not of equality of a common effect across strata; the latter needs an interaction contrast or another specified homogeneity test.
Linear-by-linear association test Created 2026-09-29 Updated 2026-11-05
For a two-way contingency table whose row and column variables are ordinal categorical variables, assign row scores and column scores . The linear-by-linear association statistic measures the weighted covariance
After normalization, its square is asymptotically under independence. A signed, one-sided version tests a specified direction of ordinal association and can have greater statistical power than an omnibus independence test against a monotone alternative.
Log-linear model Created 2026-09-24 Updated 2026-11-05
A log-linear model makes the logarithm of a positive expectation linear in model parameters. For independent cell counts with a Poisson distribution in a contingency table, write and . This is a Poisson regression with log link; finite linear predictors give strictly positive fitted cell expectations.
For a two-way table, the additive model
implies . Conditional on the total count, the cell counts have a multinomial distribution whose cell probabilities factor into row and column probabilities; this is independence of the two categorical classifications. For example, the cell-mean table has common column ratio two and odds ratio .
Adding interaction terms to the linear predictor permits association. In a table the association is measured by
It vanishes in the additive model. Hence additive main effects describe one particular log-linear model; log-linear models also include interactions and more general design matrices. Independent Poisson sampling and multinomial sampling conditional on the total use different sampling schemes, while producing this same independence structure for the normalized cell probabilities.
For observed pairings between two labels , let and , where the first label denotes the female's group and the second the male's. A mating assortment contrast is
It lies between and . Positive describes an excess of same-label pairings over cross-label pairings; whether that is evidence of assortative mating depends on the null mathematical model and the assay. The four counts form a contingency table.
Here is an original scope check. Suppose independently paired females and males have probabilities of carrying label . Then
With , the expected value is zero. With , it is , despite pairing being independent of label. This counterexample concerns unequal pool composition; it does not replace the group introductions and contingency table tests in the dietary divergence and mating isolation in Drosophila pseudoobscura experiment. Even with balanced pools, finite observed samples fluctuate: a positive alone is not a hypothesis test, much less a universal species boundary.
All three frequency tables describe 2466 valid observations with no reported missing values. The sample is overwhelmingly White, Medium is the most common efficacy category, and disagreement with the technology-failure statement is more common than agreement. These statements describe the sample rather than establish population composition or causal relationships.
In a frequency table, a count gives the number of observations in a category, and a percentage divides that count by the full sample total. A valid percentage instead uses the total with an observed value of that variable. Here the two denominators coincide because every table reports zero missing values. A cumulative percentage adds categories in the displayed order; its substantive meaning depends on whether that order is meaningful.
The ethnicity counts are 77 Asian, 57 Black and 2332 White respondents, or 3.12%, 2.31% and 94.57%. Ethnicity is a nominal categorical variable: the displayed order is not a low-to-high ethnic scale. Its cumulative percentages are bookkeeping for that listing rather than an interpretable ranking. The two minority groups are small relative to the White group, which will matter for the precision and expected cell counts of the stratified comparisons.
For the three-category efficacy measure, 908 observations are High, 972 Medium and 586 Low, giving 36.82%, 39.42% and 23.76%. Medium is the mode, and 76.24% fall in the combined High-or-Medium categories. This is an ordinal categorical variable, but the table does not imply equal numerical distances between categories. Its order is descending efficacy, High then Medium then Low. Therefore the cumulative 76.24% refers to that upper portion of the scale, not to the proportion at or below Medium under an ascending convention. The cutpoints used to form these categories are not supplied and need not be invented to interpret their frequencies.
For techfail_chr, 336 strongly disagree, 922 disagree, 490 are neutral and 718 agree: 13.63%, 37.39%, 19.87% and 29.12%. The wording concerns not trusting technology because it fails when needed. Thus moving toward Agree means more distrust, not more trust. Combining the two disagreement categories gives , versus 29.12% agreement and 19.87% neutrality. Adding the separately rounded displayed percentages gives 51.02%; the difference is ordinary rounding error. There is no displayed strongly-agree category, so its frequency cannot be inferred or added to the agreement count.
The technology percentages add to 100.01%, including the printed valid-total figure. The integer counts still sum exactly to 2466; rounded percentages need not sum exactly to 100%. Finally, three separate univariate frequency tables say nothing by themselves about which efficacy categories the trusting or distrusting respondents occupy. That requires the joint information in the later contingency tables.
The displayed age groups have fairly similar employment proportions, with no coherent monotone age trend. The printed test reports no evidence against age–employment independence; recomputing from the five visible rows reaches the same qualitative conclusion. Their totals and several auxiliary fields nevertheless do not represent one consistent table.
Each row percentage estimates an employment proportion within that age group. For example, of the youngest displayed group are employed. The employed proportions in the next four rows are , , and . The largest displayed proportion is in the 45–54 group and the smallest in the 55–64 group, a difference of about percentage points. These are conditional percentages, not the age distribution of employed people. The sequence rises and then falls; there is no simple increasing or decreasing pattern.
The null hypothesis for a Pearson chi-squared test of independence is that the joint category probabilities factor into their age and employment marginals. Its expected frequencies are , and its test statistic adds the standardized squared count discrepancies, . For a complete contingency table with positive margins, the large-sample reference chi-squared distribution has statistical degrees of freedom. Independent observations and an appropriate sampling scheme are essential; adequate expected counts make the approximation more plausible.[ref]
Reading only the printed test block, , statistical degrees of freedom and are mutually compatible. The printed likelihood-ratio test gives nearly the same p-value, about . At a prechosen 5% significance level neither rejects independence. This is a failure to find evidence, not proof of equal employment probabilities at every age. The printed Cramér's V around suggests a small sample association; the contingency coefficient around has the same broad message. The generalized phi coefficient is an unsigned chi-squared magnitude here, not evidence for a positive age trend. A small association magnitude and a large p-value answer different questions.
But only a table is actually visible. Those rows total , with employment column sums and , rather than the printed with columns and . Computing solely from the five visible rows gives
Its likelihood-ratio test statistic is about , again with statistical degrees of freedom. The smallest count-based expected frequency is about , comfortably large for this ordinary approximation, but different from the printed minimum . These figures are a labelled analysis of the visible subset, not a repaired full dataset. An unprinted sixth age row might explain some intended metadata, but neither its label nor a uniquely justified reconstruction is supplied. The oldest printed label also conflicts with Figures 1 and 8.
The ordinal measures look for an ordered tendency. Goodman and Kruskal's gamma compares concordant pairs with discordant pairs among pairs untied on both variables. The printed negative gamma, Somers' D, Kendall's tau-b and Stuart's tau-c therefore suggest, at most, a very weak tendency toward lower employment at higher age categories under the specified ordering. Their precise magnitudes are not reliable here. The ordinary unordered-pair partition for ordinal data fails for the printed pair counts, even when compared with the printed cases. On the five visible rows the respective count-based values are about , for employment conditional on age, and . None gives a substantial monotone pattern; a near-zero ordinal measure would not exclude a nonmonotone relationship in general.
Goodman and Kruskal's lambda is zero in both predictive directions on the visible table: knowing age does not improve the number of correct predictions made by always choosing the most common employment category, and knowing employment does not improve modal age-category prediction. Zero modal-prediction improvement does not mean every category distribution is identical. Both the reported test block and the separately recomputed visible-table test fail to reject independence; neither justifies asserting no association, a causal age effect, or a coherent full-sample calculation from the contradictory printout.
Within the 1424 complete records displayed here, employed respondents report more frequent use on average in the ordinal sense of positive pairwise association. The overall independence test is significant, but its sample association magnitude is modest and the result is observational. Some printed ordinal summaries are internally inconsistent.
Compare row percentages because employment groups have different sizes. Never-use is reported by of the non-employed group and of the employed group. Daily use is versus ; more-than-daily use is versus . Combining the last two categories gives versus , an employed-minus-non-employed difference of about 11.26 percentage points. That threshold comparison is a descriptive summary of the six-category table, not a replacement for the original omnibus test or a newly declared prespecified endpoint. It does not assign equal spacing to the six frequency categories.
Here the row counts, column counts and grand total are additive. Under the null hypothesis of employment–use independence, a contingency table has statistical degrees of freedom. The Pearson chi-squared statistic recomputed from the cells is , agreeing with the printed value, and its p-value is about . The likelihood-ratio test statistic gives . Both reject independence at the conventional 5% and 1% significance levels under the sampling assumptions. The minimum expected frequency, about , gives no sparse-cell warning for this table. The tests compare whole category distributions; they do not by themselves identify one category as the source of the association or establish its causal direction.
Cramér's V is . The generalized phi coefficient coincides with it for this two-row table, while the contingency coefficient is about . These are modest magnitudes; a small p-value does not make the relationship large or useful for individual prediction. The employment–use association could change after conditioning on age or other covariates, and the sample excludes cases without recorded use. Relative to the employment margins in Figure 1, the omitted complete-case counts are non-employed and employed, or about and of those groups. Different missing fractions alone do not identify the missing-data mechanism, but they rule out treating complete records as automatically representative of everyone.
The count-based Goodman and Kruskal's gamma is
With the employment categories ordered non-employed then employed and use ordered from never to more than daily, this positive value means concordant pairs outnumber discordant pairs among pairs untied on both variables. It is not a 16.9% increase in a person's use and is not a causal effect. Reversing one ordering reverses its sign. Excluding ties can make gamma appreciably larger than tie-adjusted measures.
For use as response and employment as predictor, the cells give Somers' D about , Kendall's tau-b about and Stuart's tau-c about . The printed Somers value and tau-b should not be presented as verified calculations: the table prints second-variable-only ties, whereas its cells give . The other four pair classes agree with the cells; the printed five classes sum to , not . The source does not establish an alternative tie convention that repairs those ordinary identities. The direction remains a weak positive association under either description, but the exact measures require coherent pair counts.
Modal prediction provides another perspective. Without employment information, predicting the globally most frequent use category, never, makes errors. Predicting a separate modal use category in each employment group makes errors. Thus Goodman and Kruskal's lambda for use given employment is : about a 1.97% reduction in modal-classification errors. For employment given use the corresponding reduction is . These identify the targets explicitly; the source's row-dependent/column-dependent labels should not be used to reverse the target interpretation. The two small numbers show why an independence test can be significant while coarse modal prediction improves very little. The supported overall finding is a modest positive association among observed respondents, requiring conditional analysis and a missing-data qualification before broader claims.
Each frequency table describes a marginal distribution, rather than a relationship among variables. The recorded two-category gender variable has 1,042 male and 1,093 female responses: 48.81% and 51.19%. It is a nominal categorical variable. Its ordering in the table supplies no quantitative ranking; a cumulative percentage over those arbitrarily ordered labels has no invariant substantive meaning.
Household income is an ordinal categorical variable with six bands. Their shares, from the lowest band upward, are , , , , and . The highest band alone contains 1,105 respondents, slightly more than half the sample. The bands are not a numerical income measurement with equal steps: the top band is open-ended, so an exact sample mean income cannot be recovered from these category counts alone.
The agreement item is also an ordinal categorical variable. Combining the first two categories gives
Neutral responses account for ; the two disagreement categories together account for . These percentages describe the measured vaccination intention item, rather than actual vaccination status.
All three tables have 2,135 valid observations and no missing values for these variables, so their percentages and valid percentages coincide. This is different from the seven missing group-indicator values in question 1. The income and agreement columns sum to because the displayed percentages were rounded separately. That rounding is compatible with counts summing exactly to 2,135.
The tables alone cannot show whether the gender composition differs by income, or whether vaccination intention differs between groups. Those are questions about a joint contingency table and its conditional probabilities, not about separate marginal distributions.
The displayed percentages use row denominators. The relevant comparison is therefore the conditional probability of each response within each recorded gender group, rather than the gender composition within a response category.
For the male group, strongly agree and agree. For the female group, the corresponding percentages are and . Combining the two agreement categories gives
The female group has more neutral responses, versus , and a higher combined disagreement percentage, versus . Thus the observed distributions differ in more than a single cell.
The Pearson chi-squared test assesses the null hypothesis of independence in the complete contingency table. Under that null, the expected frequency in a cell is its row total times its column total divided by 2,135. Recalculation gives
The reported p-value, approximately , gives very strong evidence against independence under the test's sampling assumptions. The minimum expected frequency is about , so sparse expected cells are not a problem here. The test concerns the full five-category distribution, not just the combined agreement comparison.
Cramér's V summarizes the magnitude without imposing an ordering on the gender labels:
The small p-value does not imply a nearly deterministic relationship. For example, the column-dependent Goodman and Kruskal's lambda is only about : choosing the modal response separately within the two groups reduces prediction errors from 1,546 to 1,506, a relative reduction of .
The positive Goodman and Kruskal's gamma must be interpreted using the table's chosen ordering. The agreement categories run toward less willingness, and gender has no intrinsic ordinal direction. A sign attached to an arbitrary group coding cannot replace the substantive comparison of conditional probabilities.
The NaN displayed for the likelihood-ratio calculation is not a valid p-value and is not evidence of no association. The Pearson chi-squared statistic can be independently recomputed from the positive cell counts. None of these calculations identifies a causal effect; the table has not controlled for income or other possible confounders.
Each row of the contingency table is a conditional distribution of the safety category among respondents with that experience status. Thus the relevant comparison uses row percentages, rather than interpreting the larger number of respondents with some bad experiences as itself an effect on safety.
The sample proportions reporting feeling very safe are without bad experiences and with some bad experiences: the latter is lower by about percentage points. Feeling fairly safe rises from to , a difference of about percentage points. Feeling unsafe changes only from to , about percentage points. The main descriptive shift is therefore from very safe toward fairly safe, rather than a large increase in the unsafe category.
Pearson's chi-squared test tests the null hypothesis that experience status and safety category are independent. If that were true, the expected cell count would be its row total times column total divided by . The Pearson chi-squared statistic sums squared observed-minus-expected count differences divided by their expected counts. Here
The expected counts are comfortably large, with minimum approximately , so the ordinary large-sample chi-squared distribution approximation is appropriate under the sampling assumptions. There is evidence against independence even at the significance level. The reported likelihood-ratio result gives the same conclusion.
Magnitude is a separate question. Cramér's V gives
which describes a weak statistical association. It does not mean that of safety is explained. Nor does the p-value measure the size of that association.
For ordinal direction, order the experience categories as none, some, and the safety categories from very safe toward unsafe. Goodman and Kruskal's gamma compares concordant pairs with discordant pairs after excluding tied pairs:
Its small positive sign then corresponds to a weak tendency toward less safety among respondents with bad experiences. The sign would reverse if exactly one category ordering were reversed. Because this contingency table has many ties, the response-direction Somers' D, which retains response ties among pairs with different predictor values, is smaller:
These coefficients describe ordered association; the omnibus Pearson's chi-squared test tests any departure from independence and does not supply a separate p-value for gamma.
The column-dependent Goodman and Kruskal's lambda makes the weak predictive improvement tangible. Predicting the overall most frequent safety category makes errors in this table. Using a separate most frequent category within each experience row makes , giving , only about a reduction in those classification errors.
The sample supports a statistically detectable but weak association, chiefly a reduced sample proportion feeling very safe. This observational study does not establish that bad experiences cause the change: reverse direction, reporting differences or confounding could also contribute. The numerical p-value also presumes the sampling and complete-case assumptions appropriate to the observations used.
Conditioning on marital status produces five contingency tables. In each, compare the conditional row percentages. The following differences are the sample proportion with some bad experiences minus the sample proportion without them, in percentage points; negative very-safe differences mean fewer respondents feeling very safe in the former group.
Marital-status stratumDifference: very safeDifference: unsafeReported Pearson's chi-squared test p-valueCramér's VGoodman and Kruskal's gamma
Single
Married
Living with a partner (inconsistent; see below)
Divorced
Widowed
The p-values test independence within the respective strata; the magnitudes and directions come from the conditional percentages and association measures. Differences in the table are calculated from the counts before rounding.
Among single respondents, the very-safe sample proportion changes from to , while the unsafe sample proportion changes from to . The direction resembles the weak pooled pattern, but supplies little evidence against independence in this stratum. This is not evidence that the population association is exactly zero.
Among married respondents, the very-safe sample proportion changes from to and the fairly-safe sample proportion rises from to . Unsafe remains almost unchanged, versus . Thus the within-stratum association again chiefly shifts very safe toward fairly safe. Its is below the significance level, while still indicates a small association.
For respondents living with a partner, very safe changes from to , fairly safe from to , and unsafe from to . The very-safe difference is larger than in the married stratum. The printed p-value would be just below the conventional significance level. However, this particular output is internally inconsistent: recalculating Pearson's chi-squared test from its six displayed counts gives , , and . The reported agrees with the counts, whereas the printed would itself imply for two statistical degrees of freedom, rather than the printed . Using the displayed counts, this stratum does not reject independence at . The source PDF itself contains these incompatible figures; this is not resolved by rounding.
Among divorced respondents, very safe changes from to , but unsafe also decreases, from to , as fairly safe increases from to . This is a redistribution toward the middle category, not a simple shift toward greater unsafety. The near-zero gamma, , reflects the lack of a consistent ordinal direction, while can still register distributional differences without a direction. The p-value does not reject independence.
Among widowed respondents, very safe changes from to , and unsafe from to . The ordinal association is positive on the chosen ordering, with gamma . Its lack of conventional statistical significance, , does not imply a smaller estimated association than in the married group: the widowed stratum has only complete observations, versus in the married stratum, and therefore less precision. All five tables have sufficiently large expected counts for the reported approximations; even the smallest expected count is about .
Figure 1.
Derived safety-category differences and unadjusted uncertainty by marital-status stratum
. Details.
The plot uses large-sample Wald confidence intervals for the difference of independent sample proportions within each stratum. They concern the individual category contrasts, whereas the tabulated Pearson's chi-squared tests compare the full three-category distributions. The intervals are unadjusted for multiple hypothesis testing; the pooled row reuses the stratum observations, so it is not a sixth independent sample.
In the elaboration model, the persistence of a generally weak positive ordinal pattern within four strata is closer to partial replication than to a complete explanation of the pooled association by marital status. The differences in estimated patterns suggest possible specification: the divorced group's shift toward the middle category differs from the widowed group's shift toward unsafe. They do not by themselves establish population effect modification. In particular, significant and nonsignificant results need not differ significantly; compare the effects using an interaction contrast or a fitted model with the appropriate interaction terms, rather than comparing their separate p-values.[ref]
One additional omnibus check can be derived from the supplied tables without assuming a common effect. Recalculating the five statistics from the counts, including the corrected living-with-partner statistic, the joint conditional independence test for stratified contingency tables gives
Under independent-stratum sampling this tests independence within every stratum jointly; it does not test whether the association is homogeneous across strata. It does not reject at , but this alone does not establish that stratification removed the population association: its ten-degree-of-freedom alternative is less focused than the pooled two-degree-of-freedom test, and nonrejection is not proof of equality.
The elaboration model also distinguishes an antecedent confounder from an intervening causal mediator. These cross-sectional tables do not establish the relevant time ordering or identify either role for marital status. Five separate stratum tests further require caution about multiple hypothesis testing: for example a Bonferroni correction at familywise would use per test, below all five individual p-values. That caution changes the interpretation of selected significance labels, not the observed conditional percentages.
The estimated patterns vary across strata, but the tables neither establish a population interaction nor prove that marital status explains away the association.
The missing output is needed to identify the actual regression formula, response column, transformations and coefficient estimates. A useful possible analysis regresses the maintained-school percentage among acceptances on the corresponding percentage among applications, allowing for year; it must be described as a model of college-level composition, not a direct estimate of individual acceptance probabilities.
For instance, if and are these two percentages, a normal linear model might specify , with a slope-by-year interaction term if needed. The intercept is the expected response at zero predictor, often an extrapolation; the slope is a percentage-point change in acceptance composition per percentage-point change in application composition. A slope of one is not by itself evidence of equal acceptance chances: equal chances within every college would give the entire relation , including zero intercept and no year shift. A fit with positive slope mainly confirms that applicant composition helps predict acceptance composition.
Regression diagnostics should include residuals versus fitted values and predictors, a residual normal Q-Q plot, checks of heteroscedasticity, regression leverage, studentized residuals and Cook's distance. The aggregate mature-college category merits an influence check and a sensitivity analysis: combining several colleges can conceal different within-college patterns. Repeated observations from the same college across years may have correlated errors, so treating them as independent needs justification. Check nonlinearity, the year interaction and the effects of excluding no observation except with a substantive reason.
Percentages are bounded, and their precision depends on their denominators. A simple weighted least squares or binomial analysis requires the underlying numbers accepted, not merely percentages. For a proportion based on people, the working variance is under independent sampling, rather than constant across colleges. If the predictor percentage is itself estimated, an ordinary regression also ignores its uncertainty. The supplied summaries cannot recover all four cells of each college contingency table or the actual fitted numerical output.
The published Cambridge percentage table nevertheless allows a descriptive comparison of acceptance rates. Write for the maintained-school proportion among applicants and for its proportion among acceptances. The relative risk from group compositions gives
The overall acceptance probability cancels by Bayes' theorem. This risk ratio compares acceptance probabilities; it is not the acceptance odds ratio, which also needs the overall acceptance probability.
For Christ's, the two published application/acceptance pairs give risk ratios and . If the displayed percentages were rounded to the nearest whole percentage point, the relative risk bounds from rounded group compositions give ranges approximately and . Thus both comparisons remain below one under that rounding assumption. These are descriptive comparisons of observed groups, without adjustment for applicant qualifications or a causal effect interpretation. The published compositions determine approximate relative acceptance rates, but not their standard errors or the original regression results.
Arrange rows by marker genotype, with cases and controls as the two columns. Both column totals are 100, and the three row totals are 100, 60 and 40. Under the null of no genetic association, estimate each common row probability from its pooled proportion. The expected count is row total times column total divided by the grand total. Thus the expected contingency table is
The Pearson chi-squared test of independence uses
Under independent sampled individuals and the no-association null, its reference chi-squared distribution has degrees of freedom. All expected cells are well above five. The null is overwhelmingly rejected: the approximate p-value is . This establishes association in the sampling model, not by itself a causal role for the marker.
Each diploid individual contributes two marker alleles. Count copies as twice the count plus the count, and count copies analogously. The observed chromosome-level contingency table, followed by its null expected table, is
There are 200 chromosomes in each group; pooled totals are 140 and 260 . The usual allelic Pearson chi-squared test of independence gives
With the ordinary independent-chromosome null model, use one degree of freedom; its p-value is about , providing very strong evidence of genetic association.
The two alleles from the same person are not automatically two independent observations. The usual one-degree-of-freedom calibration is justified, for example, for unrelated individuals with Hardy-Weinberg equilibrium under the null. If that assumption is not suitable, retain individuals as the sampling units and test their allele dosages using an appropriate variance or permutation of case-control labels, or use the genotype-level test from part (iii). No Hardy-Weinberg equilibrium assumption was needed for that genotype-level test.