Sample size for a correlation
Use Fisher’s z approximation to plan how many independent measurement pairs you need to detect a Pearson correlation different from zero.
Fit
When to use it, and when not to
Use it when
- You plan one Pearson correlation between two continuous measurements from each person.
- You want power to detect a prespecified correlation against zero.
Not when
- You want agreement between raters. Use an agreement method. Read: Bland-Altman method comparison
- You want a precise interval rather than a test against zero. Plan interval precision with a suitable method. Read: Descriptive studies and precision-based planning
- You need ranks or covariate adjustment. Plan for Spearman correlation or regression instead. Read: Spearman correlation: rank association
Before you start
What you need
- Expected Pearson correlationSupply r with an absolute value strictly between zero and one. Mallard uses its magnitude.
- Two-sided significance levelAlpha defaults to 0.05. It sets the normal cutoff for the test.
- Target powerPower defaults to 0.8. Mallard bounds it between 0.5 and 0.999.
- Different people supply independent pairs.How to check: Do not count repeated visits or clustered observations as independent people.
- The Fisher-z approximation suits the planned data.How to check: Inspect plausible joint distributions, outliers and linearity. Strong nonnormality can distort usual Pearson inference.
- The expected correlation is credible for the target population.How to check: Use prior evidence and examine smaller plausible correlations. Do not choose an effect just to reduce the sample.
Plain language
How it works
Fisher’s z is half the natural log of a ratio: one plus the correlation’s magnitude, divided by one minus that magnitude. Mallard divides the sum of the significance and power normal quantiles by this value, squares the result, then adds three. It rounds the total upward.
The null correlation is zero. A negative expected correlation gives the same total as its positive counterpart. For power at a supplied total, Mallard uses a normal approximation with the square root of the total sample size minus three. Choosing a sample-size method separates detection from interval precision.
Worked example
A worked example
- Setting
- A team plans to relate a symptom score to a continuous lab measure, with one pair per adult.
- Question
- How many complete pairs are needed to detect a correlation of 0.3 against zero?
- Approach
- Enter r = 0.3, alpha = 0.05 and power = 0.8. Use the two-sided Fisher-z approximation.
- Result
- Mallard returns 85 independent pairs in total.
- What it means
- Each person supplies both values. This target concerns detection of a nonzero linear association, not proof that the measurements agree.
In practice
Recent studies PubMed search · not vetted
Watch out
Common mistakes
The one to remember
This Fisher-z approximation tests a Pearson correlation against zero. It does not size rank correlation, agreement, repeated measurements or an adjusted association.
- Calling the target a count per group.Instead: Count people with both measurements; the calculation returns one total.
- Using the correlation between repeated visits as though visits were independent.Instead: Use a sizing method that accounts for the repeated structure.
- Reading statistical detection as clinical value.Instead: Choose the expected effect for its clinical meaning before calculating.
Inside Mallard
How Mallard uses this
Mallard returns a total number of independent pairs and approximate power at a supplied total. It uses the correlation’s magnitude.
analysis.correlation_sample_size, the id a plan cue records.Related Learn pages
Related designs and methods
Evidence
Sources & further reading
- Testing the significance of a correlation with nonnormal data: comparison of Pearson, Spearman, transformation, and resampling approaches (opens in a new tab) · Psychol Methods · doi 10.1037/a0028087
- Reducing Bias and Error in the Correlation Coefficient Due to Nonnormality (opens in a new tab) · Educ Psychol Meas · doi 10.1177/0013164414557639