Pearson Chi-Squared Conditional Randomization Test

Adel Javanmard, Mohammad MehrabiIEEE Trans. Information Theory 2025

Abstract

Conditional Independence (CI) testing—determining whether a variable $X$ affects a response $Y$ after controlling for confounding factors $Z$—is a fundamental task in statistical inference. Within the "Model-X" framework, the Conditional Randomization Test (CRT) has emerged as a robust method that does not require specific modeling of the response $Y$. However, CRT is computationally expensive, as its p-value resolution is strictly limited by the number of randomizations performed. This paper introduces the Pearson Chi-squared Conditional Randomization (PCR) test, a novel approach that transforms the CI testing problem into a multinomial uniformity test. By aggregating local ranks across data groups, PCR achieves high-resolution p-values and superior statistical power with significantly fewer computations than traditional methods.

Introduction

In fields such as genomics and economics, identifying the specific impact of a variable (e.g., a gene) on an outcome (e.g., a disease trait) while controlling for covariates (e.g., ancestry) is essential. This is the core of Conditional Independence ($Y \perp X | Z$) testing. The Model-X framework has gained popularity for this task because it shifts the modeling burden from the unknown conditional distribution of $Y|X,Z$ to the known or estimable distribution of $X|Z$.

While the Conditional Randomization Test (CRT) is the standard-bearer for Model-X inference, it faces a significant scalability challenge. To achieve a p-value of $0.001$, one must run at least 999 simulations. When the underlying score function—such as a deep neural network or LASSO regression—is computationally intensive, this requirement becomes a massive bottleneck. PCR addresses this by leveraging the i.i.d. nature of data to extract more information from fewer simulations.

Methodology

The PCR test breaks the computational bottleneck by processing the dataset in groups rather than as a single monolithic block. The workflow is as follows:

  1. Data Grouping: The dataset is partitioned into $n_g$ small, independent groups.
  2. Counterfeit Sampling: For each group, a small number of "counterfeit" versions of $X$ are generated based on the known distribution $P_{X|Z}$.
  3. Local Scoring and Ranking: A score function $T$ is applied to both the observed data and the counterfeits within each group. The observed data's score is then ranked against its corresponding counterfeits.
  4. Labeling: Each group is assigned a "label" or bin based on this rank.
  5. Chi-Squared Aggregation: Under the null hypothesis of independence, these labels should be uniformly distributed across all groups. PCR applies a Pearson Chi-squared test to detect significant deviations from this uniformity.

Unlike the standard CRT, which produces a single global rank, PCR generates a distribution of ranks. This allows the test to achieve high-resolution p-values even when the number of randomizations per group is very small.

Experimental Evaluation

Synthetic Datasets

The authors tested PCR against various linear and non-linear regression models. A critical focus was placed on "even" regression functions (e.g., $Y = X^2$), where the effect of $X$ is symmetric around zero. These scenarios are notoriously difficult for standard covariance-based tests because the average correlation is zero. While standard CRT often shows zero power in these cases, PCR demonstrated "perfect power" (a rejection rate of 1.0) by detecting the non-linear dependency through the distribution of ranks.

Capital Bikeshare Dataset

To validate the method in a real-world context, the authors analyzed trip data from Washington D.C. They tested the conditional independence of trip duration ($Y$) from variables like user type ($X$), while conditioning on start/end locations and time of day ($Z$). PCR successfully identified that "User Type" (registered vs. casual) has a highly significant conditional dependency on trip duration, reflecting the different behavioral patterns of commuters versus tourists.

Key Insights and Discussion

Breaking the Resolution Limit

PCR's primary advantage is its efficiency. It can achieve higher statistical power than CRT while requiring as little as one-fifth the number of randomizations. By aggregating information across many groups, the Chi-squared statistic effectively multiplies the evidence, providing high-resolution results without the simulation overhead.

Robustness to Estimation Error

In practice, the distribution $P_{X|Z}$ is often estimated rather than known. The authors developed a "Robust PCR" variant that utilizes an optimization-based statistic. This variant prevents the inflation of Type-I errors when there is a slight mismatch between the true distribution and the estimated model, making the test more viable for real-world applications where model misspecification is a risk.

Limitations and Future Directions

The performance of PCR involves a trade-off regarding group size ($n_g$) and the number of labels ($L$). While smaller groups provide more samples for the Chi-squared test, they may limit the complexity of the score function $T$. Additionally, while a parameter-free version using Bonferroni correction is available, it can be conservative. Future research may extend the PCR framework to handle "covariate shift," where data distributions change between training and testing phases.

Conclusion

The Pearson Chi-squared Conditional Randomization test represents a significant advancement in Model-X inference. By reframing CI testing as a uniformity test, it provides a computationally efficient, high-resolution alternative to traditional randomization tests, particularly in complex non-linear settings where traditional methods fail.

Summary updated

BibTeX
@article{javanmard2025pearson,
  author = {Adel Javanmard and Mohammad Mehrabi},
  title = {{Pearson Chi-Squared Conditional Randomization Test}},
  journal = {IEEE Trans. Information Theory},
  year = {2025},
  doi = {10.1109/tit.2025.3618595},
}
Figure