What Do East and nQuery Compute Exactly ?

A short empirical exploration of sample‑size exact engines for two‑sample binomials

Authors
Affiliation

Arocena Thomas

Oncostat

Dan Chaltiel

Anne Lourdessamy

Published

March 13, 2026

Sample‑size software often labels a design simply as “exact,” but different exact tests can lead to noticeably different sample sizes. We explored what nQuery and East are exactly doing by comparing their outputs to transparent reference implementations from the bbssr R package.

What we compared

To understand how nQuery and East behave, we compared their sample‑size outputs with several well‑established exact and asymptotic tests implemented transparently in the bbssr R package. Specifically, we examined:

  • Pearson Chi‑squared Test
  • Fisher Exact Test
  • Fisher Mid‑p Test
  • Z‑pooled Exact Unconditional Test
  • Boschloo Exact Unconditional Test

These methods cover both conditional (Fisher) and unconditional families, as well as an asymptotic benchmark (chi‑squared). Short, clear explanations of each test are available in Gosuke Homma’s documentation: Statistical methods explained

How did we compare

  • nQuery states explicitly in the UI that its two‑proportion exact design uses Fisher’s exact test.
  • East, as documented in its User Manual (p3314), uses an unconditional exact superiority test based on maximizing the probability of rejecting the null over all nuisance parameters (a score‑type unconditional approach, not Fisher’s conditional test).

To see whether the software behaves as expected, we computed an N‑ratio comparing each exact method to the sample size returned by the software.

\[ \text{N‑ratio} = \frac{N_{\text{method}}}{N_{\text{software}}}. \]

If the software truly corresponds to a given test, that test’s N‑ratio should cluster around 1.

Comparison results

nQuery: pattern matches Fisher’s exact

N-Ratio by Exact methods
according to nQuery sample sizes
method Min Q1 Moyenne Médiane Q3 Max
fisher 0.92 0.96 0.98 0.99 1.00 1.01
boschloo 0.84 0.89 0.91 0.92 0.94 0.97
z_pool 0.78 0.87 0.90 0.91 0.94 0.97
fisher_midp 0.78 0.87 0.90 0.91 0.94 0.97
chisq 0.75 0.85 0.88 0.89 0.93 0.97

N-Ratio by Exact methods
according to nQuery sample sizes
method Min Q1 Moyenne Médiane Q3 Max
fisher 0.92 0.96 0.98 0.99 1.00 1.01
boschloo 0.84 0.89 0.91 0.92 0.94 0.97
z_pool 0.78 0.87 0.90 0.91 0.94 0.97
fisher_midp 0.78 0.87 0.90 0.91 0.94 0.97
chisq 0.75 0.85 0.88 0.89 0.93 0.97

In the nQuery plot, Fisher’s N‑ratio sits tightly around 1 across all scenarios.
Unconditional tests (Boschloo, mid‑p, Z‑pooled) systematically fall below 1, as expected given their higher power.

East: behaves like an unconditional exact test

East’s documentation makes it clear1 that the method is unconditional. The empirical results confirm this:

N-Ratio by Exact methods
according to East sample sizes
method Min Q1 Moyenne Médiane Q3 Max
z_pool 0.98 1.00 1.00 1.00 1.00 1.03
fisher_midp 0.97 0.99 0.99 1.00 1.00 1.02
boschloo 0.98 1.00 1.01 1.00 1.02 1.09
chisq 0.91 0.97 0.98 0.98 0.99 1.01
fisher 1.03 1.05 1.08 1.07 1.11 1.20

N-Ratio by Exact methods
according to East sample sizes
method Min Q1 Moyenne Médiane Q3 Max
z_pool 0.98 1.00 1.00 1.00 1.00 1.03
fisher_midp 0.97 0.99 0.99 1.00 1.00 1.02
boschloo 0.98 1.00 1.01 1.00 1.02 1.09
chisq 0.91 0.97 0.98 0.98 0.99 1.01
fisher 1.03 1.05 1.08 1.07 1.11 1.20

  • Unconditional method Z‑pooled lies very close to N‑ratio = 1.
  • Fisher’s test tends to produce values above 1 because Fisher is more conservative, requiring slightly larger sample sizes.

This is the signature of an unconditional exact design.

Conclusion

NQuery implements a classical Fisher’s exact test, whereas East uses a more powerful unconditional exact test.

Because the East’s UI does not explicitly state which test should be used, users may default to the well-known Fisher’s exact test. If the sample size was calculated for the more powerful pooled-z test, this mismatch results in an underpowered trial, with potentially serious consequences.


We highly recommend exploring the excellent work of Gosuke Homma on exact tests, implemented in the {bbssr} package:
➡️ https://github.com/gosukehommaEX/bbssr

His work provides a clear and practical overview of how to choose the appropriate exact test based on study design and sample size, along with R implementations for each method.

Footnotes

  1. East 6 User Manual, Appendix U: Theory-Design - Binomial Two-Sample Exact Tests, U.2 Power of Unconditional Test of Superiority, p3314↩︎