Papers
Topics
Authors
Recent
Search
2000 character limit reached

sensitivityIxJ: Exact Sensitivity Analysis

Updated 7 July 2026
  • sensitivityIxJ is an exact, nonparametric sensitivity analysis framework for multi-level contingency tables that quantifies how unmeasured confounding alters association tests.
  • It extends Rosenbaum’s model to multi-level treatments by deriving the worst-case null distribution for any permutation-invariant test with computational shortcuts for specialized tests.
  • Implemented in R, the framework enables robust inference without collapsing treatment or outcome levels, preserving power in observational studies.

sensitivityIxJ is an exact, nonparametric sensitivity-analysis framework for observational studies with I×JI\times J or I×J×KI\times J\times K contingency tables, designed to assess how inference on association changes under unmeasured confounding when both treatment and outcome may be non-binary. It extends Rosenbaum’s sensitivity model for generic bias, derives the exact worst-case null distribution for any permutation-invariant test, and provides computationally specialized procedures for sign-score, ordinal, and general permutation-invariant statistics. The framework is implemented in the R package sensitivityIxJ and is motivated by the observation that existing sensitivity analyses for contingency tables often assume a binary treatment variable or impose strong parametric assumptions on non-binary treatment variables (Chiu et al., 23 Jul 2025).

1. Statistical setting and inferential target

The framework treats observational data as an I×JI\times J contingency table, or as an I×J×KI\times J\times K array when stratification is present. For subject ss, the treatment is denoted Zs{1,,I}Z_s\in\{1,\ldots,I\} and the observed outcome is rs{1,,J}r_s\in\{1,\ldots,J\}. Under no unmeasured confounding and Fisher’s sharp null, treatment assignment is uniform over all assignments with fixed row totals NiN_{i\cdot}:

P(Z=zF,Z(NI))=1Z(NI),\mathbb{P}(Z=z\mid\mathcal{F},\,\mathcal{Z}(\mathbf{N}_{I\cdot})) =\frac1{|\mathcal{Z}(\mathbf{N}_{I\cdot})|},

where Z(NI)\mathcal{Z}(\mathbf{N}_{I\cdot}) is the set of all assignments with fixed row totals I×J×KI\times J\times K0.

Under Fisher’s sharp null, the column totals I×J×KI\times J\times K1 are also fixed. This allows the inferential problem to be phrased as a conditional randomization problem over the set of treatment assignments compatible with the observed margins. Any permutation-invariant test statistic can then be written as I×J×KI\times J\times K2, where I×J×KI\times J\times K3 denotes the contingency table.

The central object is the worst-case null I×J×KI\times J\times K4-value at a specified hidden-bias level I×J×KI\times J\times K5. Rather than testing association only under ignorability, sensitivityIxJ asks how large the I×J×KI\times J\times K6-value can become once treatment assignment is allowed to depend on an unobserved confounder subject to Rosenbaum-type bounds. This reformulation is what makes the framework a sensitivity analysis for contingency-table association tests rather than a standard exact test.

2. Extended Rosenbaum model for multi-level treatments

To allow hidden bias, sensitivityIxJ extends Rosenbaum’s “generic-bias” model from binary treatment settings to I×J×KI\times J\times K7 treatment levels. An unobserved confounder I×J×KI\times J\times K8 affects treatment assignment through binary indicators I×J×KI\times J\times K9 that specify which treatments are pooled by the confounder, and a nonnegative bias parameter I×JI\times J0 that controls the strength of the distortion:

I×JI\times J1

Equivalently, for any I×JI\times J2,

I×JI\times J3

When two subjects share the same observed covariates, this yields the odds-ratio bound

I×JI\times J4

whenever I×JI\times J5, and the ratio equals I×JI\times J6 if I×JI\times J7.

This parameterization is flexible because I×JI\times J8 determines which treatment levels are regarded as similarly affected by the hidden confounder. In the example emphasized in the package documentation and application, I×JI\times J9 encodes bias affecting any care versus no care. A plausible implication is that the model is especially natural for observational studies in which treatment levels can be grouped into substantively meaningful exposure classes without collapsing the outcome table itself.

3. Exact worst-case null distribution

For a permutation-invariant statistic I×J×KI\times J\times K0, the worst-case null I×J×KI\times J\times K1-value at bias level I×J×KI\times J\times K2 is

I×J×KI\times J\times K3

A key result is that the maximizer I×J×KI\times J\times K4 lies at a corner of the unit cube, I×J×KI\times J\times K5; this is stated as Lemma 2. The resulting combinatorial reduction is central to the exact method (Chiu et al., 23 Jul 2025).

For general permutation-invariant tests, the search for the worst-case I×J×KI\times J\times K6 can be restricted to

I×J×KI\times J\times K7

whose size is at most I×J×KI\times J\times K8 by Theorem 1. For ordinal tests with additive scores I×J×KI\times J\times K9, Theorem 2 further reduces the candidate set to

ss0

which has size ss1. For sign-score tests with ss2, Theorem 3 shows that the search collapses to a single corner,

ss3

Given a corner ss4, the exact null ss5-value is

ss6

Theorem 4 rewrites this quantity in terms of kernels that count tables sharing specified margins and bias counts:

ss7

The closed-form recursion formulas in Theorem 4 and Lemmas 1–2 accelerate enumeration by several orders of magnitude.

4. Specialized algorithms and computational structure

The framework provides specialized procedures for three sub-families of tests. For sign-score tests with binary outcome (ss8), the null distribution reduces to a single extended hypergeometric distribution for ss9 with weights Zs{1,,I}Z_s\in\{1,\ldots,I\}0, and fast multivariate hypergeometric routines compute Zs{1,,I}Z_s\in\{1,\ldots,I\}1-values in Zs{1,,I}Z_s\in\{1,\ldots,I\}2. For ordinal tests, only Zs{1,,I}Z_s\in\{1,\ldots,I\}3 corners need be examined, and dynamic programming over Zs{1,,I}Z_s\in\{1,\ldots,I\}4 has size Zs{1,,I}Z_s\in\{1,\ldots,I\}5 rather than Zs{1,,I}Z_s\in\{1,\ldots,I\}6. For general permutation-invariant tests, the method still searches up to Zs{1,,I}Z_s\in\{1,\ldots,I\}7 candidate corners, but kernel recursion remains available for exact null computation.

The package implements both exact enumeration and a fast table-sampling method, SIS-G, which uses the same kernels for importance-sampling weights. This division between exact and sampling-based computation is important because the exact method is designed for size control, whereas the sampling approach addresses computational burden in larger problems.

A useful way to interpret the computational design is as a hierarchy. The most general formulation accommodates any permutation-invariant test; structural constraints such as ordinality or binary outcomes are then exploited to shrink the search space for hidden-bias configurations. This suggests that sensitivityIxJ is not a single test but a computational framework that adapts to the algebraic form of the statistic under study.

5. Power properties, approximations, and package interface

Simulation studies reported for the method show that tests using all Zs{1,,I}Z_s\in\{1,\ldots,I\}8 levels, described as “Opt” ordinal tests, uniformly dominate tests that collapse either rows or columns. In all four data-generating scenarios, the Zs{1,,I}Z_s\in\{1,\ldots,I\}9 (Opt) test has highest power against bias (Chiu et al., 23 Jul 2025). Power is preserved under collapsing only if two conditions both hold: the test scores rs{1,,J}r_s\in\{1,\ldots,J\}0 are equal on the combined levels, and the bias indicators rs{1,,J}r_s\in\{1,\ldots,J\}1 are identical on those levels. Otherwise power is lost. Cross-cut tests based only on extreme levels can perform well when the true association is strongly “U-shaped” or “monotone” on the extremes, but they lose power in moderate associations.

The paper also distinguishes exact inference from asymptotic approximation. Normal approximations based on exact first and second moments from Proposition 3 and Corollary 2 are much faster, but they can exceed nominal size for small rs{1,,J}r_s\in\{1,\ldots,J\}2 or imbalanced margins. Exact methods are therefore recommended for size control.

The R package exposes these ideas through a compact interface.

Function Role Key arguments or output
sensixj_table Worst-case rs{1,,J}r_s\in\{1,\ldots,J\}3-value at a specified rs{1,,J}r_s\in\{1,\ldots,J\}4 N, delta, gamma, stat, method
sensixj_senstest Sensitivity curve over a grid of rs{1,,J}r_s\in\{1,\ldots,J\}5 values returns data frame of rs{1,,J}r_s\in\{1,\ldots,J\}6 vs. rs{1,,J}r_s\in\{1,\ldots,J\}7
sensixj_plot Visualization of sensitivity curve plots rs{1,,J}r_s\in\{1,\ldots,J\}8 vs. rs{1,,J}r_s\in\{1,\ldots,J\}9
sensixj_summary Reporting robustness threshold prints largest NiN_{i\cdot}0 at which NiN_{i\cdot}1

The documented defaults are method="exact", stat="chi2", and NiN_{i\cdot}2. The package also supports ordinal analyses through a specification such as stat=list(type="ordinal",alpha,beta). In practical terms, this software layer turns the theoretical worst-case randomization calculation into a routine sensitivity workflow for observed contingency tables.

6. Early Childhood Longitudinal Study application

The principal empirical application re-analyzes the effect of pre-kindergarten care on math achievement using data from the Early Childhood Longitudinal Study, Kindergarten Class of 1998–1999. The analysis focuses on Black girls and Black boys from low-income, single-parent families. Treatment has NiN_{i\cdot}3 levels: no non-parental care, relative care, and center-based care. Outcome has NiN_{i\cdot}4 levels: number and shape, relative size, and ordinality and sequence. Gender defines NiN_{i\cdot}5 strata, so the observed structure is two NiN_{i\cdot}6 tables (Chiu et al., 23 Jul 2025).

The chosen test is ordinal, evaluated with two score sets. The “Prior” scores are

NiN_{i\cdot}7

and the “Profile” scores are estimated by alternating MLE on NiN_{i\cdot}8. The sensitivity model uses NiN_{i\cdot}9, corresponding to hidden bias that distinguishes no care from any care.

The reported results show that under no hidden bias (P(Z=zF,Z(NI))=1Z(NI),\mathbb{P}(Z=z\mid\mathcal{F},\,\mathcal{Z}(\mathbf{N}_{I\cdot})) =\frac1{|\mathcal{Z}(\mathbf{N}_{I\cdot})|},0), the P(Z=zF,Z(NI))=1Z(NI),\mathbb{P}(Z=z\mid\mathcal{F},\,\mathcal{Z}(\mathbf{N}_{I\cdot})) =\frac1{|\mathcal{Z}(\mathbf{N}_{I\cdot})|},1-values are approximately P(Z=zF,Z(NI))=1Z(NI),\mathbb{P}(Z=z\mid\mathcal{F},\,\mathcal{Z}(\mathbf{N}_{I\cdot})) =\frac1{|\mathcal{Z}(\mathbf{N}_{I\cdot})|},2 for girls and P(Z=zF,Z(NI))=1Z(NI),\mathbb{P}(Z=z\mid\mathcal{F},\,\mathcal{Z}(\mathbf{N}_{I\cdot})) =\frac1{|\mathcal{Z}(\mathbf{N}_{I\cdot})|},3 for boys. Girls remain significant up to P(Z=zF,Z(NI))=1Z(NI),\mathbb{P}(Z=z\mid\mathcal{F},\,\mathcal{Z}(\mathbf{N}_{I\cdot})) =\frac1{|\mathcal{Z}(\mathbf{N}_{I\cdot})|},4, whereas boys lose significance by P(Z=zF,Z(NI))=1Z(NI),\mathbb{P}(Z=z\mid\mathcal{F},\,\mathcal{Z}(\mathbf{N}_{I\cdot})) =\frac1{|\mathcal{Z}(\mathbf{N}_{I\cdot})|},5. A joint test via the truncated-product method also rejects at P(Z=zF,Z(NI))=1Z(NI),\mathbb{P}(Z=z\mid\mathcal{F},\,\mathcal{Z}(\mathbf{N}_{I\cdot})) =\frac1{|\mathcal{Z}(\mathbf{N}_{I\cdot})|},6. The substantive interpretation given in the study is that girls’ pre-K benefit is robust to moderate hidden bias, whereas boys’ benefit is less robust.

This application illustrates the intended use of sensitivityIxJ: not merely testing association in a multi-level contingency table, but quantifying how much unmeasured confounding would be required to overturn that association. The broader methodological significance is that this can be done without dichotomizing treatments or outcomes and without abandoning exact, non-asymptotic control of the null distribution.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to sensitivityIxJ.