Sample Size for One-Sample Tests

Complete guide to sample size calculation for one-sample studies.

Quick answer

Sample Size for One-Sample Tests in DataStatPro helps researchers understand the method, choose appropriate assumptions and outputs, and connect the analysis to publication-ready reporting. Complete guide to sample size calculation for one-sample studies.

One-Sample Sample Size Calculation with DataStatPro: Zero to Hero Tutorial

This tutorial takes you from the basics of one-sample study planning through effect sizes, alpha, power, one-sample means, one-sample proportions, calculator use, interpretation, reporting, and common mistakes. It is designed for studies comparing one group with a known, historical, regulatory, clinical, or target value.


Table of Contents

  1. Prerequisites and Background Concepts
  2. What Is One-Sample Sample Size Planning?
  3. When to Use One-Sample Calculations
  4. The Mathematics Behind One-Sample Power
  5. Choosing Planning Inputs
  6. Using the DataStatPro Calculator
  7. Worked Examples
  8. Common Mistakes and How to Avoid Them
  9. Troubleshooting
  10. Quick Reference Cheat Sheet

1. Prerequisites and Background Concepts

1.1 Null and Alternative Values

A one-sample study compares one observed sample with a reference value:

  • Reference mean, such as a national average.
  • Target product value, such as 500 mg.
  • Historical response rate, such as 40%.
  • Regulatory or clinical threshold, such as 90% compliance.

1.2 Power

Power is the probability of detecting a true effect:

Power=1βPower = 1 - \beta

Common targets are 80% and 90%. Higher power requires larger samples.

1.3 Significance Level

The significance level α\alpha is the Type I error rate. Most planning uses α=0.05\alpha = 0.05, usually two-tailed unless a directional hypothesis is justified in advance.


2. What Is One-Sample Sample Size Planning?

One-sample sample size planning answers:

How many observations are needed to detect a meaningful difference between one group and a reference value?

This is different from estimating a descriptive average. The goal is to design a test with enough probability of detecting a pre-specified meaningful departure from the reference value.


3. When to Use One-Sample Calculations

Use one-sample calculations when:

  • Comparing a sample mean with a known benchmark.
  • Testing one sample proportion against a target proportion.
  • Planning quality control or compliance testing.
  • Comparing a new process with a fixed specification.
  • Testing whether a single group exceeds a clinical threshold.

Do not use one-sample planning when comparing two independent groups or paired measurements; use two-sample or paired-sample planning instead.


4. The Mathematics Behind One-Sample Power

4.1 One-Sample Mean

The standardized effect size for a one-sample mean is:

d=μ1μ0σd = \frac{\mu_1 - \mu_0}{\sigma}

Where:

  • μ0\mu_0 = reference mean.
  • μ1\mu_1 = expected true mean.
  • σ\sigma = standard deviation.

Approximate sample size:

n(z1α/2+z1βd)2n \approx \left(\frac{z_{1-\alpha/2} + z_{1-\beta}}{d}\right)^2

4.2 One-Sample Proportion

For one proportion, planning is based on detecting a difference between a null proportion p0p_0 and expected proportion p1p_1. A normal approximation is:

n[z1α/2p0(1p0)+z1βp1(1p1)]2(p1p0)2n \approx \frac{\left[z_{1-\alpha/2}\sqrt{p_0(1-p_0)} + z_{1-\beta}\sqrt{p_1(1-p_1)}\right]^2}{(p_1-p_0)^2}

4.3 Precision-Based Planning

If the goal is a confidence interval width rather than a hypothesis test:

n=(zα/2σE)2n = \left(\frac{z_{\alpha/2}\sigma}{E}\right)^2

Where EE is the desired margin of error.


5. Choosing Planning Inputs

5.1 Effect Size

Use the minimum meaningful difference, not the difference you hope to find. Sources:

  • Clinical minimum important difference.
  • Regulatory threshold.
  • Prior literature.
  • Pilot data.
  • Stakeholder-defined practical difference.

5.2 Standard Deviation

For means, the standard deviation strongly affects sample size. Use a realistic or slightly conservative estimate.

5.3 Dropout or Unusable Data

Inflate the calculated sample:

nadjusted=n1dropoutn_{adjusted} = \frac{n}{1 - dropout}

If n=100n=100 and expected dropout is 15%:

nadjusted=100/0.85=118n_{adjusted} = 100/0.85 = 118


6. Using the DataStatPro Calculator

Step-by-Step Guide

Step 1: Select one-sample analysis.

Choose one-sample mean or one-sample proportion.

Step 2: Enter the reference value.

This is the null value or target benchmark.

Step 3: Enter the expected value.

Use the minimum meaningful value you want the study to detect.

Step 4: Enter variability or proportion inputs.

For means, enter the standard deviation. For proportions, enter p0p_0 and p1p_1.

Step 5: Set alpha, power, and tail direction.

Use two-tailed tests unless the directional claim is justified before data collection.

Step 6: Review and adjust.

Inspect the required sample size and add allowance for dropout or unusable records.


7. Worked Examples

Example 1: Quality Control Mean

Target tablet weight is 500 mg. The team wants to detect a 5 mg difference. Historical standard deviation is 8 mg, power is 80%, and α=0.05\alpha = 0.05, two-tailed.

d=5/8=0.625d = 5/8 = 0.625

Approximate planning:

n(1.96+0.840.625)2=20.1n \approx \left(\frac{1.96 + 0.84}{0.625}\right)^2 = 20.1

Use the calculator's exact t-based result for the final plan, then round up and add quality-control allowance if needed.

Example 2: Compliance Proportion

A hospital wants to show hand-hygiene compliance exceeds 80%, expecting true compliance of 88%, with 90% power and α=0.05\alpha = 0.05.

Use one-sample proportion planning with:

  • p0=0.80p_0 = 0.80
  • p1=0.88p_1 = 0.88
  • power = 0.90
  • one-tailed only if the directional test is pre-specified

Report the required number of observations and how observations will be sampled.


8. Common Mistakes and How to Avoid Them

Mistake 1: Using an Optimistic Effect Size

Plan for the smallest effect that would matter.

Mistake 2: Forgetting the Standard Deviation

For means, sample size depends heavily on variability.

Mistake 3: Using One-Tailed Tests for Convenience

Use one-tailed tests only when justified before data collection.

Mistake 4: Ignoring Missing or Unusable Data

Inflate the target sample size.

Mistake 5: Confusing Testing with Estimation

Hypothesis-test sample size and confidence-interval precision sample size are related but not identical.


9. Troubleshooting

ProblemLikely causeWhat to do
Required n is very largeSmall meaningful effect or high variabilityRe-check MCID and SD
n changes dramatically with SDVariability estimate is uncertainRun sensitivity analysis
Result differs from hand formulaExact t method vs approximationUse calculator result for final plan
One-tailed n seems much smallerCritical region is smallerConfirm directional justification
Final sample is too small after exclusionsDropout not includedInflate initial recruitment target

10. Quick Reference Cheat Sheet

QuantityMeaning
α\alphaType I error rate
1β1-\betaPower
ddStandardized one-sample mean difference
p0p_0Null/reference proportion
p1p_1Expected meaningful proportion
nadjustedn_{adjusted}Sample after dropout inflation

Reporting Template

A one-sample [mean/proportion] power analysis was conducted with α=[value]\alpha = [value], power = [value], reference value [value], expected value [value], and [SD if mean]. The required sample size was [n], inflated to [n] to allow for [dropout]% unusable observations.