Why Simulate Power for an Interaction Screen?
For a prespecified locus pair, a power calculation can use a particular model and its assumptions to predict how often a test will detect an interaction. A simulation makes those assumptions explicit by generating genotypes, phenotypes, and missing calls, then applying the planned analysis to each generated data set. This is useful when linkage disequilibrium, missingness, or the phenotype model makes a simple approximation inadequate.
The result is conditional on the scenario being simulated. It is not a guarantee that a screen will discover a biological interaction: it estimates the probability that the specified analysis rejects its null under the specified data-generating model. The test and rejection threshold must match the planned analysis. In a screen, that threshold should reflect the intended testing procedure; the simulation here does not determine how to control error across variant pairs.
Specify the Genetic and Phenotype Models
First specify allele frequencies and linkage disequilibrium (LD) for two biallelic loci, A and B. Let \(p_A\) and \(p_B\) be the frequencies of the alleles coded 1, and let \(D\) describe the difference between the haplotype frequency and the frequency expected under independence. The four haplotype probabilities are:
These probabilities must each be between 0 and 1 and sum to 1. Equivalently, \(D\) must satisfy \(\max\{-p_Ap_B,-(1-p_A)(1-p_B)\}\leq D\leq\min\{p_A(1-p_B),(1-p_A)p_B\}\). To generate one diploid individual under random mating, draw two haplotypes independently from these probabilities and count the allele coded 1 at each locus. The resulting dosages \(G_A\) and \(G_B\) are each 0, 1, or 2. This construction gives the specified LD and, under the random-union-of-haplotypes assumption, Hardy–Weinberg genotype proportions at each locus.
Next specify how the phenotype depends on those dosages. For an additive-by-additive interaction, one common quantitative-trait model is a linear mean with product term. For a binary trait, a corresponding model uses the logit of disease probability. These models define the interaction on different scales, so their coefficients and power results are not interchangeable.
For the quantitative model, this specifies normally distributed residual variation with constant variance and mean zero, independent of genotype. For the binary model, it specifies a Bernoulli outcome with the probability given by the logistic equation. In either case, the interaction alternative has \(\beta_{AB}\ne0\), and the interaction null is \(H_0:\beta_{AB}=0\). The main effects remain in both models: this is a hierarchical model. Covariates, if part of the planned analysis, should also be generated and included in both the data-generating and fitted models as appropriate.
Worked Example: Converting Allele Frequencies and LD to Haplotype Probabilities
Suppose a hypothetical pair has \(p_A=0.30\), \(p_B=0.40\), and \(D=0.06\). The feasible range for \(D\) is \(\max(-0.12,-0.42)\leq D\leq\min(0.18,0.28)\), or \(-0.12\leq D\leq0.18\), so the chosen value is feasible.
Substitution gives \(h_{11}=0.30(0.40)+0.06=0.18\), \(h_{10}=0.30(0.60)-0.06=0.12\), \(h_{01}=0.70(0.40)-0.06=0.22\), and \(h_{00}=0.70(0.60)+0.06=0.48\). The probabilities sum to \(0.18+0.12+0.22+0.48=1.00\). In each simulated individual, two draws from these four probabilities form the two haplotypes; counting allele 1 across the two draws yields each locus's dosage.
Represent Missing Genotypes and the Planned Test
Missingness must be part of the design, not an afterthought. For example, suppose each locus has an independent probability \(q_A\) or \(q_B\) of a missing genotype call, and those events are independent of genotype and phenotype. If the planned analysis requires both calls, an individual is retained only when both are observed. The probability of retaining a generated individual is then \((1-q_A)(1-q_B)\), and the expected number retained from \(n\) generated individuals is \(n(1-q_A)(1-q_B)\). This expectation is not a fixed realized sample size: the number retained varies across simulations.
That calculation depends on the stated missingness assumptions. If missingness depends on genotype, phenotype, or other variables, simulate that dependence explicitly and use an analysis that is appropriate for the resulting missing-data process. Applying complete-case analysis under an unexamined missingness mechanism can change the analyzed population or bias estimates; simply reducing the sample size by an average percentage does not represent all consequences of informative missingness.
For an additive dosage interaction, fit the same hierarchical model in every replicate and test \(H_0:\beta_{AB}=0\). For example, a likelihood-ratio test compares the model containing the product term with the otherwise identical model omitting it. The test's degrees of freedom are 1 for this single product coefficient, provided the model is identifiable and fits successfully. The significance level \(\alpha\) must be chosen to match the planned screen analysis. A single-pair threshold and a screen-wide threshold can produce different power, even with identical simulated data.
Estimate Power and Its Monte Carlo Error
Generate \(B\) independent data sets under the alternative. In each one, generate genotypes, phenotypes, and missingness; apply the planned inclusion and analysis rules; fit the model; and record whether the interaction test rejects at the chosen threshold. If \(R_b=1\) when replicate \(b\) rejects and \(R_b=0\) otherwise, the estimated power is the mean of these indicators.
The Monte Carlo standard error (MCSE) describes simulation noise in the estimated rejection probability. It does not capture uncertainty about whether the assumed allele frequencies, effect sizes, or missingness rates are realistic. Conditional on a fixed scenario and a valid analysis, each rejection indicator is Bernoulli with probability equal to power. Independent replicates therefore have variance \(\text{Power}(1-\text{Power})\), and the sample mean has variance \(\text{Power}(1-\text{Power})/B\). Replacing the unknown power by its estimate and taking the square root gives the displayed MCSE.
Worked Example: Estimating Quantitative-Trait Power
Consider a hypothetical design with \(n=2{,}500\), \(q_A=q_B=0.05\), and a quantitative phenotype generated from the normal-error model. Let the simulated effects be \(\beta_A=0.20\), \(\beta_B=0.15\), and \(\beta_{AB}=0.35\) phenotype units per dosage-product unit, with residual standard deviation \(\sigma=1\) phenotype unit. Assume the haplotype probabilities are valid, residuals are independent of genotypes, missing calls follow the independent mechanism stated above, and the planned model is identifiable.
The probability both calls are observed is \((1-0.05)(1-0.05)=0.9025\). Thus, the expected complete-pair sample size is \(2{,}500(0.9025)=2{,}256.25\), or about 2,256 individuals. This is an expectation across data sets, not a sample size to impose in every replicate.
Suppose \(B=2{,}000\) simulated data sets are analyzed using the planned one-degree-of-freedom likelihood-ratio test at \(\alpha=0.05\), and 1,416 reject \(H_0\). Then \(\widehat{\text{Power}}=1{,}416/2{,}000=0.708\), or 70.8%. Its MCSE is \(\sqrt{0.708(1-0.708)/2{,}000}=\sqrt{0.000103368}\approx0.0102\), about 1.02 percentage points. This estimate concerns detection under the stated model and test; it does not mean there is a 70.8% probability that the interaction is real.
A Binary-Trait Simulation and Scenario Comparisons
Binary outcomes require generating event probabilities from the fitted scale's model, then drawing each outcome from a Bernoulli distribution. The baseline coefficient should be chosen to represent a plausible baseline risk at the reference genotype, and all effect coefficients must be interpreted on the log-odds scale in a logistic model. A simulation should also track model failures: silently counting nonconverged fits as non-rejections changes the estimated performance of the planned procedure.
Worked Example: Binary-Trait Power with Genotype Missingness
For a hypothetical binary-trait design, let the baseline risk at \(G_A=G_B=0\) be 0.08, so \(\beta_0=\log\{0.08/(1-0.08)\}\approx-2.442\). Set \(\beta_A=0.20\), \(\beta_B=0.25\), and \(\beta_{AB}=0.60\) on the log-odds scale. Generate each outcome as Bernoulli with probability given by the logistic model. Suppose \(n=3{,}000\), each genotype has an independent 10% missing-call probability, and analysis requires both genotypes.
The probability of retaining both genotypes is \(0.90^2=0.81\), so the expected complete-pair sample size is \(3{,}000(0.81)=2{,}430\). In each replicate, fit the hierarchical logistic model and compare it with the model omitting \(G_AG_B\), using the planned one-degree-of-freedom likelihood-ratio test and a specified threshold. If 1,260 of 2,000 valid replicates reject, the estimated power is \(1{,}260/2{,}000=0.630\). The MCSE is \(\sqrt{0.630(0.370)/2{,}000}\approx0.0108\), about 1.08 percentage points. This is power for this hypothetical logistic model and design, not for a quantitative-trait interaction of the same numerical coefficient.
Worked Example: Comparing Missingness Scenarios
Suppose the quantitative-trait simulation above is repeated with identical genetic and phenotype parameters, but both loci now have 20% independent missing-call rates. The complete-pair probability is \(0.80^2=0.64\), giving an expected retained sample of \(2{,}500(0.64)=1{,}600\). Imagine that 1,040 of 2,000 replicates reject under this scenario. The estimated power is \(1{,}040/2{,}000=0.520\), with MCSE \(\sqrt{0.520(0.480)/2{,}000}\approx0.0112\). Compared with 0.708 in the first hypothetical run, the estimate is 18.8 percentage points lower. The difference is consistent with fewer usable genotype pairs, but the simulation alone does not establish that missingness is the only factor affecting power: the comparison is informative only because all other scenario inputs and analysis rules were held fixed.
Validation, Interpretation, and Common Pitfalls
A simulation is only as trustworthy as its data generation and analysis. Before estimating power, check that haplotype probabilities are nonnegative and sum to one; simulated allele frequencies and LD are near their targets; and the generated phenotype distribution and missing-call rates match their specifications. Confirm that the fitted model includes the intended main effects and interaction, and that the test and threshold match the planned analysis. Report the number of replicates, estimated power, MCSE, and the assumptions that define the scenario.
It is also useful to simulate under the null, setting \(\beta_{AB}=0\), and measure the rejection rate. Under a correctly calibrated test and a sufficiently large number of replicates, this rate should be compatible with the intended \(\alpha\), allowing for Monte Carlo variation. A substantial discrepancy can reveal model mismatch, a coding error, convergence problems, or inappropriate use of the test. For small or sparse genotype cells, some replicates may be unidentifiable; report their frequency and decide in advance how the planned analysis handles them.
Power is scenario-specific. Rather than relying on one set of assumed values, a useful design study can vary plausible allele frequencies, LD, interaction effects, residual variation or baseline disease risk, and missingness rates. This reveals which assumptions most influence detection and makes clear what the estimated power does—and does not—support. Because simulation error decreases only at the rate \(1/\sqrt{B}\), more replicates are especially useful when comparing scenarios whose estimated powers are close.
Check Your Understanding
Use the model assumptions stated in this tutorial when answering.
- For \(p_A=0.25\), \(p_B=0.30\), and \(D=0.02\), calculate all four haplotype probabilities and check that they are feasible.
- If both loci have independent 8% missing-call rates and analysis requires both calls, what proportion of individuals is expected to be retained?
- In \(B=1{,}000\) replicates, 640 tests reject. Calculate the estimated power and its MCSE.
- Why should a null simulation accompany a power simulation, and what would an unexpectedly high rejection rate suggest?
- Explain why power estimates from a logistic interaction model cannot be interpreted as power for a quantitative-trait model with the same numerical interaction coefficient.