Tutorials › Statistical Genetics › Checking Null Calibration by Simulation

Multiple Testing and Association Calibration · Tutorial 374 of 989

Checking Null Calibration by Simulation

Use null simulations to check whether an association procedure rejects at its stated rate and whether its test statistics follow the expected null distribution.

Intermediate 9 min read

What You'll Learn

  • Define a null simulation target for an association test
  • Choose phenotype simulation or resampling that respects the study design
  • Estimate rejection rates and their Monte Carlo uncertainty
  • Compare simulated statistics with their theoretical null distribution
  • Recognize evidence of anti-conservative or conservative inference
  • Interpret calibration checks without treating them as proof of validity

Why Check Calibration by Simulation?

An association test is calibrated when, under its null hypothesis and the assumptions of its model, its reported significance level corresponds to the intended probability of rejecting a true null hypothesis. A test that claims a 5% type I error rate should reject about 5% of the time across repeated datasets generated under that null. In genetic association studies, this can be checked by repeatedly simulating or resampling phenotypes while holding relevant features of the study design fixed.

A simulation check is a diagnostic of a specified analysis under a specified data-generating setup. It can reveal that an implementation or modeling choice produces too many or too few small p-values, or a test-statistic distribution that differs from its reference distribution. It does not establish that the simulated setup matches every feature of the real study, nor does it prove calibration for all genetic variants or all possible alternatives.

Definition: A null calibration simulation repeatedly generates or resamples data under a stated null model, applies the planned association analysis to each replicate, and compares the resulting rejection frequency or test-statistic distribution with its nominal null expectation. Anti-conservative inference rejects more often than the nominal rate under the simulated null; conservative inference rejects less often.

Specify the Null Simulation

Start by stating what is null and what is held fixed. For example, a single-variant test may have a null hypothesis of no association between genotype dosage and phenotype after adjustment for specified covariates. A useful simulation can hold the observed genotypes and covariates fixed, generate a phenotype under that null model, and rerun the complete planned association analysis. This asks a conditional question: does the analysis behave as intended for these genotypes and covariates, under the chosen phenotype model?

The simulated data must reflect the features needed for the null distribution to be meaningful. These may include covariate effects, phenotype type, family or relatedness structure, ancestry or other population structure, and the test’s variance or link model. If the null model is composite—for example, it includes unknown nuisance parameters—those parameters need to be specified or estimated in a way appropriate to the simulation. The check then assesses the procedure under those choices; it is not automatically an exact guarantee for every possible nuisance-parameter value.

Two common approaches are parametric simulation and resampling. In parametric simulation, draw new phenotypes from an explicit null model, such as a normal linear model or a binary-outcome model with no genotype effect but with specified covariate effects. In resampling, rearrange observed outcomes or suitable residuals to create null replicates. Resampling requires a valid exchangeability argument: under the null, the observations being rearranged must be interchangeable under the design and conditioning assumptions. Unrestricted shuffling is generally not justified merely because the tested genetic effect is null.

For a genome-wide analysis, the test statistics at different variants are usually dependent because genotypes can be correlated through linkage disequilibrium and population structure. Simulations should preserve the genotype data when the goal is to assess the full analysis pipeline. When estimating uncertainty in a genome-wide summary, account for dependence among variants; treating every variant-by-replicate result as independent can make uncertainty appear too small.

Worked Example: Estimating a Single-Test Rejection Rate

Suppose a hypothetical study uses a two-sided association test with nominal significance level \(\alpha=0.05\). The analyst holds the genotypes and covariates fixed, generates 1,000 independent phenotypes under a specified no-association model, and runs the planned test once per simulated phenotype. The test rejects in 73 replicates.

The estimated null rejection rate is $$ \hat{r}=\frac{73}{1000}=0.073. $$ This is 7.3%, compared with the nominal 5%. Under independent replicates with true rejection probability \(0.05\), the count of rejections has a binomial distribution with \(B=1000\) trials and expected count \(1000(0.05)=50\). Its standard deviation is $$ \sqrt{B\alpha(1-\alpha)} =\sqrt{1000(0.05)(0.95)} =\sqrt{47.5} \approx 6.892. $$ The observed count is 23 above the nominal expected count, or \(23/6.892\approx 3.34\) binomial standard deviations. This is a noticeable discrepancy under this simulation setup and merits investigation. It is not, by itself, proof that the test is anti-conservative in the real study: the result depends on the specified null model, the fixed design, and Monte Carlo variation.

Quantifying Monte Carlo Uncertainty

A simulation estimate is itself subject to random variation. If \(B\) independent null replicates are generated and \(R\) of them reject at the chosen threshold, the estimated rejection rate is \(\hat{r}=R/B\). If each replicate has the same true rejection probability \(r\), then \(R\) has a binomial distribution and $$ \operatorname{SE}(\hat{r})=\sqrt{\frac{r(1-r)}{B}}. $$ Because \(r\) is generally unknown, a useful approximate standard error is \(\sqrt{\hat{r}(1-\hat{r})/B}\). When comparing with a specified nominal rate \(\alpha\), the null simulation’s expected Monte Carlo standard error is \(\sqrt{\alpha(1-\alpha)/B}\). These quantities help distinguish a substantial discrepancy from an ordinary fluctuation in a finite simulation.

The binomial calculation assumes independent simulation replicates with the same rejection probability. It applies, for example, to independent generated phenotypes on a fixed design when each replicate is analyzed once. If replicates share random elements, or if the reported rate pools many correlated tests from the same simulated dataset, the simple binomial standard error may not be appropriate. In that case, define the independent simulation unit clearly and assess variability at that level.

Increasing \(B\) reduces Monte Carlo uncertainty at a rate proportional to \(1/\sqrt{B}\). It does not correct a misspecified null model, an invalid resampling scheme, or a flawed test. A very precise estimate of the wrong simulation target remains a precise answer to the wrong question.

Worked Example: Choosing the Number of Null Replicates

A researcher wants to estimate a 5% rejection rate with a Monte Carlo standard error of about 0.005, or half a percentage point. Using the nominal rate in the standard-error formula, solve for \(B\): $$ 0.005\approx\sqrt{\frac{0.05(0.95)}{B}}, \qquad B\approx\frac{0.05(0.95)}{0.005^2} =\frac{0.0475}{0.000025} =1900. $$ Thus about 1,900 independent replicates are needed for that approximate precision near a 5% rejection rate. This is a planning calculation, not a guarantee that the observed estimate will be within exactly 0.005 of 0.05. For substantially finer precision, many more replicates are required; for example, reducing the target standard error by a factor of two requires about four times as many replicates.

Check Both Rejection Rates and Distributions

A rejection-rate check focuses on one or more thresholds. A distribution check uses more of the simulated output: compare the simulated test statistics with the distribution assumed by the test, or compare simulated p-values with their null expectation. For a valid test based on a continuous, correctly specified null distribution, p-values are uniformly distributed on the interval from 0 to 1 under the null. In particular, the probability of a p-value at or below \(\alpha\) is \(\alpha\). With discrete tests or estimated nuisance parameters, this uniformity may be approximate or conservative rather than exact.

For a one-degree-of-freedom score or Wald test, for example, the reference statistic may be a chi-square random variable with one degree of freedom under the null. Compare the simulated distribution with that reference across its center and tails. A test may have a broadly similar center but an excess of extreme values, or it may be shifted throughout the distribution. Looking at more than one summary can help describe the discrepancy, although the pattern alone does not uniquely identify its cause.

Worked Example: Diagnosing Excess in the Upper Tail

Consider 2,000 independent hypothetical null replicates of a one-degree-of-freedom chi-square association test, using the reference cutoff \(3.841\) for a 5% upper-tail test. There are 128 statistics above that cutoff. The simulated rejection rate is $$ \hat{r}=\frac{128}{2000}=0.064, $$ or 6.4%. Under a calibrated test, the expected number above the cutoff is \(2000(0.05)=100\), and the binomial standard deviation of that count is $$ \sqrt{2000(0.05)(0.95)} =\sqrt{95} \approx 9.747. $$ The observed count is 28 above expectation, about \(28/9.747\approx 2.87\) standard deviations. Suppose the simulated median statistic is also 0.49, compared with the theoretical median of approximately 0.455 for a chi-square distribution with one degree of freedom. Together, the slightly higher median and excess above the upper-tail cutoff suggest some upward discrepancy in this simulated setting. They do not establish why it occurs; possible explanations must be investigated against the model, data-generating process, and analysis implementation.

Resampling Must Respect the Design

A permutation-based null check is credible only when the chosen permutations preserve the structure needed under the null. If phenotype distributions differ by a covariate, unrestricted permutation of phenotypes can erase that covariate relationship. If observations are clustered or related, shuffling individuals independently can break their dependence. The resulting replicates may therefore represent a different null world from the one the test is intended to handle.

Worked Example: Comparing Unrestricted and Stratified Resampling

In a hypothetical study, ancestry group is associated with both genotype frequencies and the mean phenotype. The scientific null is no genotype effect conditional on ancestry. An analyst compares two null checks, each with 5,000 replicates: unrestricted phenotype permutation across all participants gives 420 rejections at \(\alpha=0.05\), while a resampling scheme that preserves the ancestry strata gives 260.

The estimated rates are \(420/5000=0.084\), or 8.4%, for unrestricted permutation and \(260/5000=0.052\), or 5.2%, for the stratified scheme. Under the null rate 0.05, the expected count in 5,000 independent replicates is 250, with standard deviation $$ \sqrt{5000(0.05)(0.95)} =\sqrt{237.5} \approx 15.41. $$ The stratified count is 10 above expectation, which is about \(10/15.41\approx 0.65\) standard deviations. The unrestricted count is 170 above expectation, about \(170/15.41\approx 11.03\) standard deviations. These results indicate that the unrestricted procedure is poorly matched to the conditional null in this example; they do not prove that stratified resampling is correct in every respect. Its validity still depends on exchangeability within strata and on whether the resampling scheme preserves other relevant features.

A Practical Calibration Workflow

1
State the target null.
Specify the association null, the nominal threshold, the test, and which genotypes, covariates, and design features are fixed or regenerated.
2
Choose a defensible generator.
Simulate outcomes from the null model or resample only under a justified exchangeability scheme. Preserve relevant structure such as covariate effects, strata, or clusters.
3
Repeat the full analysis.
For every replicate, apply the same test and analysis steps intended for the study, including the same handling of covariates and missing data where relevant.
4
Summarize and qualify.
Report the replicate count, number of rejections, estimated rate, nominal rate, and Monte Carlo uncertainty. Compare statistic distributions with their stated reference and interpret any discrepancy in light of the simulation assumptions.

Interpretation and Common Pitfalls

A simulation can help separate a calibration problem in the analysis from a signal pattern in observed data. If a procedure shows excess rejection under a well-justified null simulation, its observed small p-values deserve caution. Conversely, a rejection rate near nominal in one simulation is limited evidence: it supports calibration for that simulated setup and sample size, not universal validity or correct modeling of the actual study.

  • Too few replicates. A small simulation can show an apparently high or low rejection rate by chance. Report \(B\) and quantify Monte Carlo uncertainty rather than treating \(\hat{r}\) as exact.
  • Invalid exchangeability. Shuffling outcomes without preserving covariate or dependence structure can simulate the wrong null. State why the resampling units are interchangeable.
  • Changing the target unintentionally. Simulating genotypes as well as phenotypes answers a different question from holding the observed genetic design fixed. Say which features are conditioned on and which are regenerated.
  • Reading one summary as a diagnosis. An excess rejection rate identifies a discrepancy under the simulated setup, not its cause. Check the null generator, implementation, and model assumptions before assigning an explanation.
  • Confusing calibration with power. A null simulation assesses false-positive behavior under the chosen null; it does not measure the probability of detecting a true genetic effect.
Key takeaway: A null simulation checks a test against a stated data-generating model. Its most useful result is not simply whether the rejection rate equals the nominal level, but how precisely it was estimated, whether the resampling or simulation respects the design, and which parts of the statistic distribution depart from expectation.

Check Your Understanding

Answer each question by identifying both the numerical comparison and the assumptions that support it.

  1. In 800 independent null replicates, a test rejects 52 times at \(\alpha=0.05\). What is the estimated rejection rate, and what is the nominal expected rejection count?
  2. Why does increasing the number of null replicates reduce Monte Carlo error but not repair a misspecified null model?
  3. A phenotype is associated with a covariate under the null of no genetic effect. What concern arises if phenotypes are permuted freely across covariate groups?
  4. What does an excess of simulated statistics above a reference cutoff suggest, and what does it not establish?
  5. Why may treating every variant in every simulated genome as an independent observation understate uncertainty in a genome-wide calibration summary?
Clinical Biostats