Skip to content

Two-Way ANOVA for qPCR: Testing Treatment, Genotype, and Their Interaction

two-way ANOVA qPCR gene expression treatment genotype·Aug 7, 2026

You ran a drug on wild-type and knockout animals and measured a target gene. The drug clearly changes expression in the wild-types. The obvious question — the reason you bred the knockouts — isn’t “does the drug work?” but “does the drug’s effect depend on the genotype?” A t-test can’t answer that, and running four separate t-tests just inflates your false-positive rate. The test that answers it is a two-way ANOVA, and the single decision that makes or breaks it is what you feed in. Here’s a worked 2×2 example end to end.

When you actually need a two-way ANOVA

Reach for it when you have two crossed categorical factors — here, genotype (WT, KO) and treatment (vehicle, drug) — and every combination is represented. A two-way design buys you three tests at once: a main effect for each factor and, the usually-interesting one, the interaction: whether the effect of one factor changes across levels of the other. If your real question contains the word “depends” — does the response to treatment depend on genotype? — the interaction term is your hypothesis.

The decision that breaks most analyses: run it on ΔCq, not fold change

This is where qPCR two-way ANOVAs go wrong. ANOVA assumes the response is roughly normal with similar variance across groups, and that effects add. Fold changes are ratios — they’re log-normal, their variance grows with the mean, and they don’t add. Cq values are already on a log2 scale, so the normalized log-quantity is the right input:

$\Delta Cq = Cq_{\text{target}} - Cq_{\text{reference}}$

Run the ANOVA on per-sample ΔCq (each biological replicate’s target Cq minus its reference Cq), then translate the resulting effects back to fold change for reporting. Running ANOVA directly on 2−ΔΔCq fold changes violates the variance assumptions and gives you p-values you can’t trust. The same logic is why error bars and statistics on qPCR data belong in the log domain, and why the delta-delta Ct method subtracts Cq values rather than dividing expression ratios.

Common Mistake Pasting 2−ΔΔCq fold changes into a stats package and running ANOVA on them. The fold-change scale compresses down-regulation into 0–1 and stretches up-regulation into 1–∞, so a two-fold increase and a two-fold decrease look wildly unequal to the test even though they’re symmetric in biology. Always test on ΔCq.

Worked example: a 2×2 design

Four biological replicates per cell (n = 4), target normalized to a validated reference gene. These are the per-cell mean ΔCq values — remember that lower ΔCq means higher expression, because it’s a Cq difference:

Mean ΔCqVehicleDrugDrug − Vehicle
Wild-type5.03.0−2.0
Knockout5.04.8−0.2

The interaction is a difference of differences

The drug lowers ΔCq by 2.0 cycles in wild-types but only 0.2 in knockouts. The interaction contrast is exactly that gap:

$(\bar{\mu}_{WT,drug} - \bar{\mu}_{WT,veh}) - (\bar{\mu}_{KO,drug} - \bar{\mu}_{KO,veh}) = (-2.0) - (-0.2) = -1.8 \text{ cycles}$

An interaction of nearly two full Cq is large, and it’s the whole result: the drug’s effect on this gene depends on the genotype. Translate to fold change for the paper — a 2.0-cycle drop is roughly \(2^{2.0} \approx 4\)-fold up-regulation in wild-types, while a 0.2-cycle drop is \(2^{0.2} \approx 1.15\)-fold, i.e. essentially no change in knockouts.

The main effects, and why they’re secondary here

From the marginal means: the treatment main effect is the vehicle average (5.0) minus the drug average (3.9), a 1.1-cycle drop averaged across genotypes; the genotype main effect is 0.9 cycles. But when the interaction is significant, the main effects are averages over a relationship that isn’t constant — the “average drug effect” of 1.1 cycles describes neither genotype well. That’s the rule: a significant interaction makes the main effects conditional, so you interpret the interaction first and report main effects with that caveat.

Why Type III sums of squares Biological replicates rarely survive in equal numbers — a dropout or a failed well leaves cells unbalanced. With unequal cell sizes, Type I sums of squares depend on the order you enter the factors. Type III SS tests each effect adjusted for all others, so the result doesn’t change with factor order. Use Type III for any real, slightly-unbalanced qPCR design.

Reading the ANOVA table

Your output has three rows — Factor A (genotype), Factor B (treatment), and the A×B interaction — each with an F-statistic, a p-value, and ideally a partial eta-squared effect size. The F-statistic for each effect is its variance divided by the within-cell error variance; a large interaction relative to replicate noise gives a small p-value. Report partial eta-squared (\(\eta_p^2\)) next to each p-value, because with n = 4 a real effect can miss significance and a tiny effect can reach it — the effect size tells the reader the magnitude the p-value alone hides. The MIQE guidelines expect you to name the statistical method and software you used, so record “two-way ANOVA, Type III SS, partial eta-squared” in the methods rather than a bare “ANOVA.”

If the interaction is significant, don’t stop at “significant.” Follow with post-hoc comparisons (Tukey HSD) of the cell means to say which combinations differ — here, WT-drug versus everything else. Phrase the conclusion as dependence, not causation: “the drug’s effect on expression depends on genotype,” not “the knockout causes drug resistance.”

Check the assumptions before you trust the p-value

  • Equal variances — Levene’s test across the four cells. A significant Levene result means the cells have unequal spread and the F-test is unreliable.
  • Normal residuals — Shapiro-Wilk on the model residuals, not on the raw data. At qPCR sample sizes this test has little power, so inspect the residuals too.
  • Non-parametric fallback — when normality fails, the Scheirer-Ray-Hare test is the rank-based two-factor analogue that still gives you an interaction term.
  • Cell size — fewer than ~4 biological replicates per cell leaves a two-way ANOVA badly underpowered to detect an interaction; how many replicates you need is worth settling before the experiment, not after.

Where this breaks

Two-way ANOVA handles exactly two factors. Three crossed factors (genotype × treatment × timepoint) need a three-way model; repeated measures on the same animal over time need a repeated-measures or mixed model, because the samples aren’t independent. And none of this rescues a weak normalization — if your reference gene isn’t stable across genotype and treatment, the ΔCq you’re testing is already biased, and no ANOVA fixes that. Confirm the normalizer holds across every cell of the design with a geNorm or NormFinder stability check before you test for an interaction.

Set the experiment up as ΔCq per biological replicate, test the interaction first, check Levene and the residuals, and report effect sizes beside p-values. AnnealIQ runs a two-way factorial ANOVA directly on your ΔCq values with Type III sums of squares, runs Levene’s and Shapiro-Wilk automatically, falls back to Scheirer-Ray-Hare when normality fails, and draws the interaction plot — expanding the post-hoc comparisons when the interaction is significant and using “depends on” language in the interpretation rather than implying causation.

Ready to try AnnealIQ?

Free during beta. No credit card required.

Join the beta