Prompt

How do I calculate sample size for an experiment?

Technology / AB Testing & Experimentation1 observationLast seen Oct 13, 2026

Latest observation

Oct 13, 2026OpenAI APIWeb search: off

To calculate sample size for an experiment, you usually need these ingredients:

  1. Significance level ((\alpha))
    Commonly 0.05. This is the chance of a false positive.

  2. Power ((1-\beta))
    Commonly 0.8 or 0.9. This is the chance of detecting a real effect.

  3. Effect size
    The smallest difference you care about detecting.

  4. Variability
    Standard deviation for continuous outcomes, or baseline conversion rate for proportions.

  5. Test type / design
    For example: two-sample t-test, paired test, chi-square test, regression, etc.

Basic idea

Sample size is determined by:

  • how small an effect you want to detect,
  • how noisy the data are,
  • how strict you want to be about false positives,
  • how much power you want.

Common formulas

1) Comparing two means

If you want to compare two independent groups:

[ n_{\text{per group}} = \frac{2\sigma^2 (z_{1-\alpha/2} + z_{1-\beta})^2}{\delta^2} ]

Where:

  • (\sigma) = standard deviation
  • (\delta) = difference in means you want to detect
  • (z_{1-\alpha/2}) = z-value for your significance level
  • (z_{1-\beta}) = z-value for your power

Example values:

  • (\alpha = 0.05 \Rightarrow z_{1-\alpha/2} = 1.96)
  • power = 0.8 (\Rightarrow z_{1-\beta} = 0.84)

So:

[ n_{\text{per group}} \approx \frac{2\sigma^2 (1.96 + 0.84)^2}{\delta^2} ]


2) Comparing two proportions

For A/B tests with binary outcomes:

[ n_{\text{per group}} = \frac{\left(z_{1-\alpha/2}\sqrt{2\bar p(1-\bar p)} + z_{1-\beta}\sqrt{p_1(1-p_1)+p_2(1-p_2)}\right)^2}{(p_2-p_1)^2} ]

Where:

  • (p_1) = baseline proportion
  • (p_2) = expected proportion after treatment
  • (\bar p = (p_1+p_2)/2)

Practical steps

  1. Define your primary outcome.
  2. Decide the minimum effect you care about.
  3. Estimate variability from prior data or a pilot.
  4. Choose (\alpha) and power.
  5. Use the relevant formula or a power calculator/software.

Tools

You can use:

  • R: power.t.test, pwr
  • Python: statsmodels.stats.power
  • Online power calculators
  • Spreadsheet tools for rough estimates

Example

Suppose:

  • You want to detect a mean difference of 5 units
  • Standard deviation is 20
  • (\alpha = 0.05)
  • power = 0.8

Then:

[ n \approx \frac{2(20^2)(1.96+0.84)^2}{5^2} ]

[ n \approx \frac{2(400)(7.84)}{25} \approx 251 ]

So you’d need about 251 participants per group.


If you want, I can calculate the sample size for your specific experiment if you tell me:

  • outcome type (mean or proportion),
  • expected baseline,
  • minimum detectable effect,
  • standard deviation or baseline rate,
  • desired power,
  • significance level.

Brands

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.