Conditional randomization test Created 2026-09-28 Updated 2026-11-05
A conditional randomization test tests by resampling the tested variable from its conditional law given the remaining covariates. For independent sample rows, hold the observed fixed and draw each replacement vector from the true product conditional law of . Under the null hypothesis, the original and these replacements are conditionally exchangeable. Applying the same prespecified test statistic and fitting rule to every dataset therefore gives the valid rank-based Monte Carlo testThe add-one convention and conservative treatment of ties give finite-sample type I error control. Other resampling constructions are possible when they preserve the same conditional exchangeability.[ref]
Replacing the true conditional law by an estimate does not automatically preserve that guarantee. For a counterexample without , let the true be a fair Bernoulli random variable and let be constant, so independence holds. If the resampling model incorrectly uses and the test statistic is , the model assigns upper-tail probability whenever the observed . That event actually occurs with probability , so the limiting simulation test rejects far more often than level permits.
Estimated conditional models require a separate calibration or approximation argument. More resamples reduce Monte Carlo error but do not correct a wrong conditional law. The method tests conditional independence; interpreting it as a causal effect test requires the appropriate additional causal inference assumptions.
Consider independent binomial counts under the common-probability null hypothesis, with fixed positive row sizes . Let , and assume . Conditional on , the probability mass function is the displayed multivariate hypergeometric distribution: in the joint likelihood, the factor is common to all admissible tables and cancels. The Vandermonde identity gives the denominator, so the conditional distribution is free of the unknown nuisance parameter .
For a table , its Pearson chi-squared statistic isAn exact conditional p-value sums the displayed probabilities over all tables with the same margins and . The ordering is by the Pearson chi-squared statistic, rather than by the probability of an individual table; different exact-test orderings can give different answers. Enumeration is practical when and the number of rows are small. Monte Carlo tests can approximate the same tail by sampling tables with fixed margins.[ref]
Pearson's Chi-squared Test for Count Data in the R documentation. Details: simulated contingency-table tests sample tables with fixed marginals and use the Pearson statistic
An exact arithmetic comparison is easy too. Let be the least common multiple of the row sizes. Compare the integersince every table has the same positive denominator . This includes boundary ties without a floating-point tolerance. Conditional p-values are discrete and can be conservative; “exact” concerns their null calibration, not equality of rejection probability with every chosen significance level.
Every displayed age stratum has a higher reported-Yes proportion among Populist respondents, but the size varies considerably. The largest difference is at ages 25–34 and the smallest at 45–54. The omnibus tests reject within-stratum independence for ages 25–34 and 35–44, but not for the other three groups; comparing those significance labels is not itself a test of statistical interaction.
The five strata contain 298, 291, 339, 296 and 405 complete cases. They sum to 1629 and reproduce every cell of the overall table, so the comparison is a coherent age stratification. Each body percentage estimates a blocking-response conditional distribution within a particular age and populism combination. Not know is retained as the third valid response. The ordinal statistics discussed below are numerical summaries of the displayed order only, because that response order has no established behavioural rank.
For ages 18–24, reported blocking is among Not-populist respondents versus among Populist respondents, a difference of about 8.11 percentage points. No is 71.43% versus 66.00%, and Not know is 9.18% versus 6.50%. The Pearson result is on 2 statistical degrees of freedom, ; the likelihood-ratio test gives , . Thus neither rejects at 5%. The minimum expected frequency is 7.235, so no cell falls below five. Cramér's V and the generalized phi coefficient are about 0.095, with contingency coefficient about 0.094. The ordered-label summaries are gamma 0.203, Somers' D 0.095, tau-b 0.092 and tau-c 0.084. Both lambdas are zero. These figures allow a positive descriptive Yes difference alongside considerable uncertainty; nonrejection does not establish identical response distributions.
For ages 25–34, reported blocking is versus , a difference of about 19.57 percentage points. No falls from 75.68% to 64.06% and Not know from 14.86% to 6.91%. Pearson gives , on 2 statistical degrees of freedom; the likelihood ratio gives , . Its printed 0.000 is rounding, not an exact zero. Both indicate nominal evidence against independence, although the Pearson value is just above 0.001 rather than below it. The minimum expected count is about 6.612. V and generalized phi are about 0.218, and the contingency coefficient about 0.213. The ordered-label gamma is about 0.500, Somers' D 0.239, tau-b 0.211 and tau-c 0.181. Neither direction of lambda improves modal prediction: No remains the modal response in both rows and Populist the modal group in each column. In particular, gamma 0.500 does not mean that populism explains half the variation in blocking.
For ages 35–44, reported blocking is versus , a difference of about 10.73 percentage points. No is nearly unchanged, 76.58% versus 76.32%, while Not know falls sharply from 14.41% to 3.95%. The full categorical association therefore includes a substantial awareness-category difference. Pearson gives , ; the likelihood ratio gives , , each on 2 statistical degrees of freedom. The minimum expected count is about 8.186. V and generalized phi are about 0.220 and the contingency coefficient about 0.215. Ordered-label gamma is 0.477, Somers' D 0.187, tau-b 0.200 and tau-c 0.165. Lambda for predicting the blocking category from populism is zero. In the reverse direction it is about 0.063: Not know has more Not-populist than Populist respondents, so allowing the response to change the predicted classification slightly reduces errors. This is a nominal prediction result, not a causal mechanism.
For ages 45–54, reported blocking is versus , only about 0.45 percentage points apart. No is 71.62% versus 78.38%, and Not know is 16.22% versus 9.01%. Here most of the descriptive distributional difference is between No and Not know rather than between the reported-Yes proportions. Pearson gives , ; the likelihood ratio gives , , with 2 statistical degrees of freedom. The minimum expected count is 8. V and generalized phi are about 0.101 and the contingency coefficient about 0.100. Ordered-label gamma is 0.164, Somers' D 0.067, tau-b 0.066 and tau-c 0.050; both lambdas are zero. A positive ordered-label coefficient therefore should not be substituted for a substantial difference in Yes rates.
For ages 55+, reported blocking is versus , a difference of about 3.02 percentage points. No is 87.78% versus 86.35%, and Not know is 6.67% versus 5.08%. Pearson gives , ; the likelihood ratio gives , , with 2 statistical degrees of freedom. V and generalized phi are about 0.053, with contingency coefficient about 0.053. One of six expected counts is below five, with minimum about 4.889. This is a mild sparse-cell qualification rather than a missing observation; an exact conditional test or fixed-margin Monte Carlo test could check calibration if needed. No simulated p-value is claimed. Ordered-label gamma is 0.184, Somers' D 0.043, tau-b 0.052 and tau-c 0.030, with both lambdas zero.
The Goodman and Kruskal's gamma, Somers' D, Kendall's tau-b and Stuart's tau-c values differ because their denominators handle ties or table dimensions differently. All the supplied pair partitions and numerical values agree with the counts. Their substantive ordinal interpretation remains limited by Not know. In contrast, Cramér's V and Goodman and Kruskal's lambda permit nominal categories; zero lambda means no improvement in modal classification, not absence of all association.[ref]
DescTools documentation for gamma, Somers' D and lambda. Details: ordinal-scale assumptions for gamma and Somers' D, versus nominal modal prediction for lambda
[ref]Ordinal association measures in the DescTools documentation. KendallTauB and StuartTauC: different tie and table-size conventions
Reported blocking within age and populism groups, with count-derived age-specific and standardized percentage-point contrasts; Not know remains a valid response
. Details. Holding age fixed does not eliminate the positive descriptive difference in reported Yes rates: none of the five differences reverses sign. Thus the evidence does not show a Simpson's paradox in which every conditional direction opposes the pooled direction. There is also little evidence for a single common magnitude from inspection: differences range from about 0.45 to 19.57 points. The elaboration model provides a useful language of persistence and possible specification, but these tables alone do not establish causal explanation or population effect heterogeneity.
As a clearly defined descriptive adjustment, use the complete-case age shares as common weights for both groups. Standardization with common weights gives reported-Yes proportions about 10.70% for Not-populist and 18.75% for Populist respondents, a difference of 8.04 percentage points, compared with the crude 7.26-point difference. Equalizing that age composition therefore does not explain away the observed contrast. It is not a causal effect, and its target remains the observed complete-case sample.
There is also nominal combined evidence against conditional independence. The joint conditional independence test for stratified contingency tables sums the five Pearson statistics to about 37.0169; under the usual independent-stratum asymptotic model this has 10 statistical degrees of freedom and . This derived test addresses whether all five full response distributions are conditionally independent, not whether their effects are equal or whether Yes alone differs in every stratum. A direct interaction contrast or appropriate categorical-response model is needed to test effect differences on a specified scale. Multiple separate tests additionally create a multiple testing issue if used selectively. The warranted conclusion is a persistent positive descriptive Yes association after age stratification, strongest at 25–34, with formal heterogeneity, missing-data and causal questions still requiring explicit assumptions and targeted analysis.
The White stratum retains the overall distrust–lower-efficacy pattern, the Asian stratum shows a stronger but irregular version of it, and the Black stratum has an opposite descriptive ordinal direction. This supports replication in the dominant stratum together with possible specification by ethnicity in the elaboration model. Sparse minority tables and different significance labels do not by themselves establish a population statistical interaction.
Each table fixes ethnicity and compares the efficacy conditional distributions across technology responses. The body percentages use the technology-response row total within that stratum. The same labels, coding direction and efficacy order apply as before. The strata contain 77, 57 and 2332 observations; they sum to 2466 and their cells reproduce the overall table exactly. Consequently the comparison is genuinely a stratification of the supplied overall counts, rather than a comparison of unrelated samples.
For Asian respondents, High efficacy is 78.95% among those who strongly disagree with the distrust statement, falling to 23.81% among those who disagree, 18.75% among neutral respondents and 19.05% among those who agree. The strong-disagreement versus agreement contrast is about 59.90 percentage points, based on 15 of 19 versus 4 of 21 respondents. This is a large descriptive contrast, but the rest of the table is not a simple monotone progression: Low efficacy peaks at 47.62% in Disagree, versus 10.53% in Strongly disagree, 18.75% in Neutral and 23.81% in Agree; Medium efficacy exceeds 57% in the last two rows. The striking first row is part of a more irregular categorical pattern.
The Asian Pearson chi-squared test of independence gives , 6 statistical degrees of freedom, . The likelihood-ratio test gives , ; its displayed 0.000 is a rounding convention. Cramér's V is about 0.430, compared with 0.148 overall. The generalized phi coefficient is 0.608 and the contingency coefficient 0.519. Two of twelve expected frequencies are below five, with minimum 4.156. This is a modest sparse-cell warning rather than a reason to delete the observed cells, but asymptotic calibration should still be qualified and could be checked by an exact or fixed-margin Monte Carlo test.
The Asian Goodman and Kruskal's gamma is about 0.323, from 1025 concordances and 524 discordances, so its displayed-order direction agrees with the overall association. Somers' D for efficacy given technology is about 0.226, Kendall's tau-b 0.241 and Stuart's tau-c 0.253. These stronger ordinal summaries do not imply that every individual row transition is monotone. Goodman and Kruskal's lambda is about 0.362 for predicting efficacy from technology and 0.286 in the reverse direction: the technology row changes the modal efficacy prediction sufficiently to reduce its errors by about 36.2%. This is a reduction in modal-classification errors, not a fraction of efficacy variance explained.
For Black respondents, High efficacy is 0 of 6, or 0%, in Strongly disagree; 8 of 24, or 33.33%, in Disagree; 2 of 15, or 13.33%, in Neutral; and 7 of 12, or 58.33%, in Agree. Low efficacy is 16.67%, 25.00%, 20.00% and 8.33%, respectively. The strongest-disagreement versus agreement High-efficacy contrast is therefore percentage points, opposite to the Asian and White contrasts. The zero observed High count in the first row does not prove zero population probability, especially with only six respondents in that row. These percentages are compatible with a reversed tendency, but considerable sampling uncertainty is unavoidable.
The Black Pearson chi-squared test of independence gives , 6 statistical degrees of freedom and . The likelihood-ratio test gives , , also above 5%. Thus neither nominal test rejects at 5%; this does not establish exact independence. Eight of twelve expected frequencies are below five, with minimum about 1.158, making the usual large-sample calibration particularly questionable. An exact conditional analysis or Monte Carlo test would be more defensible for a calibrated inferential claim; no uncomputed simulated p-value is asserted.[ref]
Pearson's Chi-squared Test for Count Data in the R documentation. Details: fixed-margin sampling for simulated contingency-table tests
The Black Cramér's V is about 0.308, the generalized phi coefficient 0.435 and the contingency coefficient 0.399. An unsigned magnitude of this size can coexist with a nonsignificant test in a small sample. There are 254 concordances and 457 discordances, giving Goodman and Kruskal's gamma about , Somers' D about , Kendall's tau-b about and Stuart's tau-c about . Their negative signs agree with the reversed displayed-order direction. Goodman and Kruskal's lambda is about 0.107 for efficacy given technology and zero for technology given efficacy. In the latter direction, Disagree remains a modal technology category within every efficacy column, so modal prediction gains nothing despite the changed conditional percentages.
For White respondents, High efficacy decreases from 48.55% in Strongly disagree through 43.10% and 32.03% to 27.45% in Agree. The extreme-row contrast is about 21.11 percentage points, from 151 of 311 versus 188 of 685. Low efficacy is 21.22%, 17.10%, 21.57% and 35.04%, respectively. This closely resembles the overall distribution, including the fact that the Low category is not monotone at every step. The White Pearson chi-squared test of independence gives , 6 statistical degrees of freedom and ; the likelihood-ratio test gives , . All expected frequencies exceed 74, so sparse cells are not the problem for these nominal tests.
The White Cramér's V is about 0.152, the generalized phi coefficient 0.215 and the contingency coefficient 0.210. Goodman and Kruskal's gamma is about 0.236, Somers' D 0.155, Kendall's tau-b 0.162 and Stuart's tau-c 0.167: close to the overall ordinal summaries and in the same direction. The two values of Goodman and Kruskal's lambda are about 0.061 for efficacy given technology and 0.062 for technology given efficacy. They again indicate only a small improvement in modal prediction. The large sample size helps explain why the White test has a much smaller p-value than the smaller strata, without implying that its association magnitude is the largest.
The original figure below plots selected empirical conditional probabilities from all the cells. It gives the opposite small-stratum pattern and the dominant White pattern a common scale; it is not a reproduction of a source figure, an estimated continuous trend or a display of uncertainty intervals.
Efficacy distributions across technology-distrust responses: contrasting ethnic strata and the pooled sample. Lines only connect the four ordered categories; group sizes and sparse cells limit inference.
Details. The elaboration model asks how the original association changes when a third variable is held fixed. If the association disappeared throughout the strata, an explanation by the control variable might be plausible, subject to a credible causal ordering. Here it persists in the White group, which supplies 94.57% of the sample, and is stronger on several descriptive measures in the Asian group. Therefore ethnicity does not simply explain away the relationship. The White result is a replication of the broad pattern; the reversed Black direction and the Asian shape suggest descriptive specification or possible effect modification. The output supplies no temporal or causal design that would distinguish an actual causal mechanism from other confounding, measurement differences or sampling variation. It also does not demonstrate a Simpson's paradox in which the association reverses in every stratum: that is not what the displayed tables show.
The predominance of White respondents explains why the pooled pattern resembles theirs. By the law of total probability, each technology row's efficacy distribution is a mixture over ethnicity, using the ethnic proportions within that technology row. Those weights need not equal the overall ethnic proportions. As an optional descriptive comparison, standardization with common weights using the overall ethnic shares gives High-efficacy proportions of about 48.38% in Strongly disagree and 27.90% in Agree, a 20.48-percentage point contrast, compared with the crude 21.69-point contrast. This explicitly defined adjustment leaves the broad contrast intact; it is not a causal estimate and does not turn the three different stratum patterns into one common effect.
Finally, a significant test in one group and a nonsignificant test in another is not itself a test that the groups' associations differ. A formal statistical interaction requires a directly specified heterogeneity test or model on a chosen effect scale. The omnibus tests also address whole categorical distributions, whereas gamma and the High-efficacy contrast describe particular ordered features. Multiple stratum tests create a multiple testing issue if used to select a discovery. The defensible result is an association that survives stratification in the dominant group, with important descriptive heterogeneity that merits a direct, sparse-cell-aware investigation rather than an assertion that ethnicity causes the difference.
Every displayed age stratum has a higher proportion of employed respondents reporting use at least daily, and each has positive ordinal association. The visible counts do not support the printed claim of a conventional significant omnibus result in any one stratum: several test fields are contradictory, and sparse cells further limit the chi-squared approximation. Age-specific significance labels do not establish interaction or causation.
Conditioning on age means comparing the employment groups within each displayed age category. Each within-row percentage estimates a use distribution for that age–employment combination. This helps assess a marginal association that could reflect different age compositions, but broad age categories do not remove all residual confounding. The relevant conditional-independence null hypothesis is that employment and use are independent within every age stratum. It differs both from marginal independence and from a null hypothesis that the strength of association is identical across ages.
For the 14–24 stratum, . The non-employed group reports use at least daily in of cases, versus of employed cases: an 11.13-percentage-point difference. Daily use alone is versus . This is not a uniform upward shift at every threshold: never-use is also higher among employed respondents, versus , whereas weekly use is lower, versus . The count-based Cramér's V is about and Goodman and Kruskal's gamma about . The cells give on statistical degrees of freedom, with , agreeing qualitatively with the likelihood-ratio result , . The printed Pearson and disagree with the cells and with one another: that printed statistic at statistical degrees of freedom would give about , not . Four of twelve expected frequencies are below five, with minimum about , so an exact conditional test or a Monte Carlo test is preferable for calibrated inference rather than trusting a marginal printed significance label.
For ages 25–44, . At-least-daily use is in the non-employed group and in the employed group, a difference of 11.06 percentage points. Never-use is versus , daily use versus , and more-than-daily use versus . The count-based Cramér's V is about and Goodman and Kruskal's gamma about . The visible cells give , , and , , each with statistical degrees of freedom. These differ materially from the printed Pearson , , and printed likelihood-ratio , . Even the printed Pearson statistic at its stated statistical degrees of freedom gives , not the stated p-value. The minimum expected frequency is about , so the principal difficulty here is corrupted numerical output rather than a listed sparse-cell warning. The recomputed 5% test fails to reject independence, although its p-value is not evidence that the positive descriptive contrast is exactly zero.
For ages 45–54, . At-least-daily use is versus , a difference of 9.03 percentage points. Never-use is versus , and daily use versus . The count-based Cramér's V is about and Goodman and Kruskal's gamma about . The cells give , , consistent with the likelihood-ratio , . The printed Pearson and are incompatible with the cells and with one another: using that statistic at statistical degrees of freedom gives . The smallest expected frequency is about . Thus this is another positive descriptive contrast without a count-supported significant omnibus result at 5%.
For ages 55–64, . At-least-daily use is versus , a difference of 7.89 percentage points. Never-use is versus , and daily use versus . Cramér's V is about and Goodman and Kruskal's gamma about . The printed and count-based Pearson result agrees: , statistical degrees of freedom, . The likelihood-ratio p-value is about . Two of twelve expected frequencies are below five, with minimum about ; the nominal result does not indicate rejection, but a simulation-based check would be prudent if formal calibration mattered. Neither a large p-value nor the smaller sample establishes an absence of association.
For the oldest stratum, labelled 65+ in Figure 8, . At-least-daily use is versus , a difference of 5.61 percentage points. Never-use is versus . Cramér's V is about and Goodman and Kruskal's gamma about , the largest of the five displayed strata. Yet on statistical degrees of freedom gives , while the likelihood-ratio p-value is about . There are four expected frequencies below five, with minimum about . Sampling uncertainty and a sparse distribution therefore matter greatly; the larger descriptive ordinal magnitude is not evidence for a significant age interaction. The zero observed entries do not establish zero population probabilities. An exact conditional test or a Monte Carlo test can retain the six categories without relying on a doubtful asymptotic approximation. Collapsing categories should have a substantive justification; searching for a grouping that produces significance changes the inferential problem.[ref]
Pearson's Chi-squared Test for Count Data in the R documentation. Details: asymptotic versus simulated fixed-margin tests and the role of positive margins
The following original analytical plot summarizes a common threshold rather than reproducing any source table. Its overall reference is deliberately separated: the five age strata total , not the in Figure 3, so their percentages cannot be pooled and called the reported overall result.
At-least-daily use is more common among employed respondents in each displayed age stratum; the printed overall row is a separate, non-reconciling input
. Details. Across the visible strata, frequent use declines strongly with age in both employment groups, while the at-least-daily employment difference remains positive. This is compatible with age being important to the use distribution and with a positive employment association persisting after age stratification. It is not a demonstrated Simpson's paradox: none of these displayed threshold differences reverses direction. The evidence also does not establish how much age confounds the overall result, because the strata do not reproduce its sample and the oldest age labels disagree across figures. Among young respondents the positive ordinal association coexists with a reversed never-use contrast, so the threshold summary should not be described as stochastic domination of every conditional distribution.
Ordinal measures summarize a different aspect from the omnibus tests. Counting pairs from each visible table gives Goodman and Kruskal's gamma approximately in age order. For use as response, the corresponding Somers' D values are about ; Kendall's tau-b values are ; and Stuart's tau-c values are . They are all positive and modest, but not interchangeable. Gamma discards pairs tied on either variable; Somers' D includes response ties separated by employment; Kendall's tau-b adjusts for ties in both variables; Stuart's tau-c adjusts for table dimensions. The printed second-variable tie counts violate the unordered-pair partition for ordinal data in all five strata, so the printed Somers and tau-b values should not be accepted as independently verified numbers.[ref]
Ordinal association measures in the DescTools documentation. KendallTauB and StuartTauC: distinct tie/table-size adjustments
Goodman and Kruskal's lambda for predicting the use category from employment is zero in all five visible strata: each employment row has the same modal use category as its stratum overall. This does not contradict their nonzero gamma or V, because the rest of each category distribution can change without its mode changing. Reversing the prediction target gives about for predicting employment from use. In the original display these are the second lambda values; identify the target directly rather than relying on ambiguous row/column-dependent labels. The contingency coefficient, another unsigned transformation of the Pearson statistic, adds no new direction and cannot repair a corrupted test statistic.
Even if all printed p-values were trusted, a significant result in one age group and a nonsignificant result in another would not prove that their effects differ. A statistical interaction needs a direct comparison of effects on a specified scale, not a comparison of significance labels. Five separate tests also create a multiple-testing issue if the aim is to claim at least one association; choosing categories or a threshold after inspection adds further selection. A joint conditional independence test for stratified contingency tables or an appropriate categorical-response model can target a clear combined hypothesis, with exact or simulation-based calibration where needed. Such a model would require coherent input tables before it could resolve the source discrepancies. The sound conclusion is a consistent positive descriptive tendency within the five shown strata, with no count-supported nominal 5% omnibus rejection in an individual stratum, and insufficient coherent output for a claimed causal or precisely quantified age-adjusted effect.
The association remains positive within each income group, although its estimated size is smaller in the higher-income groups. The two extreme trust categories give the following conditional vaccination percentages and differences:
| Annual household income | Lowest trust | Highest trust | Difference in percentage points |
|---|---|---|---|
| Below £20,000 | 36.36% | 89.60% | 53.24 |
| £20,000–£40,000 | 50.00% | 93.10% | 43.10 |
| £40,000 and above | 66.67% | 91.14% | 24.47 |
In the lowest-income group, the intervening percentages are 42.86%, 44.12% and 82.54%, so the increase is monotone. Its Pearson chi-squared statistic is approximately 62.520 on four statistical degrees of freedom, with the printed asymptotic . Cramér's V is approximately 0.441, Goodman and Kruskal's gamma is approximately 0.626 and the column-dependent Somers' D is approximately 0.259. The column-dependent Goodman and Kruskal's lambda is approximately 0.158: trust improves the modal prediction more here than in the pooled table.
In the middle-income group, the intervening vaccination percentages are 61.54%, 81.82% and 92.04%. The printed Pearson chi-squared statistic is approximately 24.033 on four statistical degrees of freedom, with asymptotic . Cramér's V is approximately 0.298, Goodman and Kruskal's gamma approximately 0.454 and column-dependent Somers' D approximately 0.100. Column-dependent Goodman and Kruskal's lambda is zero: vaccinated respondents are the majority in every row, so the modal prediction never changes. A zero lambda does not mean independence.
In the highest-income group, the intermediate vaccination percentages are 71.43%, 76.92% and 94.55%; the final category falls slightly to 91.14%. Thus the observed pattern is broadly positive rather than strictly monotone. The printed Pearson chi-squared statistic is approximately 8.199 on four statistical degrees of freedom, with asymptotic . It does not reject independence at 5%. The corresponding Cramér's V is approximately 0.229, Goodman and Kruskal's gamma approximately 0.281 and column-dependent Somers' D approximately 0.058. The column-dependent Goodman and Kruskal's lambda is again zero.
Small counts limit the asymptotic tests, especially in the middle- and highest-income tables. Their minimum expected counts are approximately 0.644 and 0.306, with respectively 30% and 40% of cells below five. The lowest-income table has one expected count below five, with minimum approximately 3.315. These diagnostics concern expected counts under independence, not just the observed row sizes.
The supplied counts are sufficient to make an exact conditional Pearson test for a binary contingency table, without needing individual records or assuming a chi-squared distribution approximation. Conditioning on the row totals and total unvaccinated count removes the common unknown binomial probability. For each admissible table, sum its multivariate hypergeometric distribution probability when its Pearson chi-squared statistic is at least the observed one. Complete enumeration gives:
| Income group | Enumerated tables | Exact conditional p-value |
|---|---|---|
| Lowest | 507150 | |
| Middle | 22379 | |
| Highest | 2585 |
These are new exact conditional calculations, rather than the paper's printed asymptotic p-values. They confirm evidence of association in the first two groups and nonrejection at 5% in the third, while showing the numerical effect of sparse cells. The tail is ordered by the Pearson chi-squared statistic; an exact test with a different ordering need not have the same p-value. Fixed-margin Monte Carlo tests approximate this same Pearson-ordered tail when enumeration is impractical.[ref]
Pearson's Chi-squared Test for Count Data in the R documentation. Details: fixed-marginal simulation for contingency-table Pearson tests
The original count-based figure below includes pointwise approximate 95% Wilson intervals. The very wide intervals for sparsely populated trust categories make the uncertainty visible; they are not simultaneous intervals or a formal test of differences between income groups.
In the elaboration model, the positive direction is replicated after conditioning on income: income does not fully explain away the observed trust–vaccination relationship. The decreasing estimated contrasts and ordered coefficients suggest possible specification by income, or effect modification on an explicitly chosen scale. They do not establish it. Different p-values can arise from different sample sizes and standard errors; significant and nonsignificant results need not differ significantly. A formal statistical interaction test or a confidence interval for differences between comparable contrasts would address that question.[ref]
The Practice of Social Research (13th edition) by Earl Babbie. Chapter 15, Table 15-5: replication, specification and the causal ordering needed for explanation or interpretation
Nor do these conditional tables prove that income is a causal confounder or causal mediator. Those labels require assumptions about causal order, relevant confounding and how variables were measured. This is an observational study of recorded vaccination status, not a randomized change in trust or a test of vaccine effectiveness.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 34 2 h Solution Created 2026-10-03 Updated 2026-10-07
Assuming independent digits under Benford law, put and . The count vector has a multinomial distribution, with expected counts . Suitable predictive discrepancy statistics include the Pearson chi-squared statistic and multinomial deviance:The zero-count terms of have limiting value zero. A Monte Carlo method gives a direct null comparison even when expected counts are small.
For example, an original R implementation is:Each column returned by
benford_check <- function(y, B = 9999L) {
p <- log10(1 + 1/(1:9))
n <- sum(y)
expected <- n*p
observed <- sum((y - expected)^2/expected)
replicas <- rmultinom(B, size = n, prob = p)
simulated <- colSums((replicas - expected)^2/expected)
(1 + sum(simulated >= observed))/(B + 1)
}rmultinom is a replicated count vector. R recycles the nine expected counts down each column. The add-one ratio is a Monte Carlo test estimate. In WinBUGS, alternatively generate a replicated dmulti vector using fixed , compute its discrepancy and monitor exceedance of the observed value. The null does not estimate unknown digit probabilities. Dependence or selection in the accounts would require an appropriate simulation model.Official documentation for
stats::chisq.test. It distinguishes asymptotic chi-squared distribution calibration from Monte Carlo tests, and explains fixed-margin sampling for simulated contingency table tests. A finite simulation has limited p-value resolution.


