Sample Size Planner

Correlation / regression

Plan the required sample size to detect a non-zero correlation or slope in simple linear regression with your chosen confidence level, power, and expected effect size. Connect planning directly to the Pearson correlation and bivariate regression tools.

👨‍🏫 Professor Mode: Guided Learning Experience

New to sample size for regression? Enable Professor Mode for step-by-step guidance through determining sample requirements for correlation and regression studies!

OVERVIEW & WHAT THIS TOOL SOLVES

Before collecting survey responses or regional store data to test whether two continuous metrics move together—such as customer engagement and Net Promoter Score, or local ad spend and store revenue—you need to know how many observations it takes to separate a real linear relationship from random noise. The Correlation & Simple Regression Sample Size Planner uses Fisher's z-transformation to compute the exact sample size needed to detect your target correlation or bivariate slope at your chosen confidence and power.

🎯 Questions It Answers

  • How many customers, stores, or weeks do we need to detect a small (r = 0.10), moderate (r = 0.30), or strong (r = 0.50) correlation?
  • How many observations are required to test whether a correlation exceeds a non-zero benchmark (e.g., r1 = 0.40 vs. r0 = 0.20)?
  • How does required sample size change when planning a simple linear regression slope test?

📂 What Data You Need

  • Expected Correlation (r1): The strength of linear association you want your study to be able to detect (−0.99 to +0.99).
  • Null Benchmark (r0): Baseline correlation under the null hypothesis (usually 0 for "no linear relationship").
  • Confidence & Power: Desired significance level (α) and statistical power (1 − β), plus two-sided vs. one-sided test choice.

💡 What You'll Discover

  • Required Observation Count (n): Minimum paired observations needed to power both Pearson's r and the bivariate OLS slope test.
  • Cohen's Effect Size Benchmarks: Instant reference against standard small (0.10), medium (0.30), and large (0.50) correlation thresholds.
  • Power & Sensitivity Curves: Visual charts mapping sample size across varying correlations and power levels.
🔍 Key Nuances & Common Traps to Watch For
  • Why Correlation and Simple Regression Share the Same Sample Size: In a bivariate linear regression with one predictor, the t-test for whether slope β1 = 0 is mathematically identical to the test for whether Pearson correlation r = 0 (since r2 = R2). Powering for correlation r automatically powers the simple regression slope test.
  • Why Fisher's z-Transform Is Used: The sampling distribution of raw correlation r becomes skewed as r moves away from zero. Fisher's arctanh transformation converts r into a nearly normal variable z(r) whose standard error depends only on sample size.
  • Small Correlations Require Large Samples: Detecting a moderate correlation of r = 0.30 (at 95% confidence, 80% power) takes ~85 observations, whereas detecting a subtle r = 0.10 takesnearly 782 observations.
📐 Under the Hood: Model Equations & Variable Definitions
1. Fisher's z-Transformation & Required Sample Size Formula
\[ z(r) = \frac{1}{2} \ln\!\left(\frac{1 + r}{1 - r}\right), \qquad \mathrm{SE}\big(z(r)\big) \approx \frac{1}{\sqrt{n - 3}}, \qquad n \approx 3 + \left(\frac{z_{1-\alpha^*} + z_{1-\beta}}{\lvert z(r_1) - z(r_0) \rvert}\right)^2 \]
💬 Read it in plain English: We convert both the expected correlation (r1) and null correlation (r0) onto Fisher's variance-stabilized z-scale; required sample size is 3 plus the squared sum of confidence and power critical values divided by the squared gap between z(r1) and z(r0).
r1, r0
Expected & Null Pearson Correlations YOUR DATA ⓘ
Target correlation you want to detect (r1) and baseline correlation under the null hypothesis (r0).
z(r), SE(z)
Fisher's z-Transform & Standard Error OUTPUT ⓘ
Normalized correlation score z(r) and its sampling standard error 1 / √(n − 3).
z1−α*, z1−β
Significance & Power Critical Multipliers INFERENCE ⓘ
Normal critical values for false-positive rate α* and statistical power 1 − β.
n
Required Paired Sample Size OUTPUT ⓘ
Minimum number of independent paired observations (Xi, Yi) required.

MARKETING SCENARIOS

Use presets to explore common marketing questions, such as the correlation between ad spend and revenue or the relationship between engagement and Net Promoter Score. Each scenario sets an expected correlation, a null correlation (usually 0), and default confidence/power so you can see how many observations you need before running a full regression or correlation analysis.

INPUTS & SETTINGS

Design the study

Effect size (correlation)

Correlation under the null (often 0 for "no association").

Small effects: ~0.1, moderate: ~0.3, large: ~0.5 or more.

Effect size (regression)

Baseline correlation under the null hypothesis for the slope test (often 0 for "no linear association").

The correlation you would consider a meaningful regression effect to be able to detect.

For simple regression with one predictor, the significance test on the slope is determined by the correlation between \(X\) and \(Y\). This view lets you set \(r_0\) and \(r_1\) while thinking in "slope" language; the planner uses these same values to compute how many observations you need for both the Pearson correlation and the simple regression slope test.

Confidence = 1 - alpha for a two-sided test.

Common choices are 80% or 90% power.

Advanced settings

Two-sided tests are standard when any increase or decrease in the association matters. One-sided tests focus on a directional effect and reduce the required sample size, but must be justified by your decision context.

Additional info about these settings

Confidence level & alpha: The confidence level (for example, 95%) describes how often the procedure would capture the true correlation if you repeated the experiment many times. Alpha is the tolerated false-positive rate (for example, 5% for a 95% confidence, two-sided test).

Effect size (correlation r): The null correlation \(r_0\) and expected correlation \(r_1\) describe how strong a linear relationship you want to be able to rule out or detect. Small correlations (around 0.10) are subtle; moderate (around 0.30) are noticeable; large (around 0.50+) indicate a strong linear trend.

Power: Power is the probability that your test will detect the specified correlation if it is really present in the population. Higher power reduces the risk of a false negative but requires more observations.

Test type (one- vs. two-sided): Two-sided tests look for any increase or decrease in the correlation, which is standard when you care about changes in either direction. One-sided tests focus on a specific direction (for example, positive correlation only) and can reduce required sample size, but they ignore evidence in the opposite direction.

VISUAL OUTPUT

Required total sample vs. effect size

This chart shows how required sample size changes as the absolute difference \(|r_1 - r_0|\) grows. Stronger correlations (larger \(|r_1|\) away from \(r_0\)) reduce the required sample size for the same confidence and power.

Required total sample vs. power

This chart plots required sample size against desired power, holding the effect size and alpha fixed. Higher power (greater sensitivity) always requires a larger sample size.

DESIGN SUMMARY

Required total sample size (N): –
Null vs. expected correlation: –
Design alpha / confidence: –
Design power: –
Test type: –

Statistical Planning Statement

Provide a null correlation, expected correlation, alpha, and power to generate a concise planning statement.

Managerial Interpretation

This panel translates the design into plain language, explaining roughly how many paired observations you need to detect the planned association at your chosen confidence and power.

How to interpret this sample size

Once you enter a null correlation, expected correlation, confidence level, and power, this section will explain what the required total sample size (N) means in practical terms. It will draw on your current settings to give a plain-language example of how often the study would successfully flag a real association versus how often it might miss it or produce a false alarm.

DIAGNOSTICS & ASSUMPTIONS

Diagnostics & Assumption Checks

These sample size formulas assume independent observations, reasonably linear relationships, and no extreme outliers. They are planning-level approximations: once you collect data, you should still inspect scatterplots, residuals (for regression), and stability across segments.

If the required sample size is infeasible, you can target a larger effect (for example, \(r_1 = 0.4\) instead of 0.2), lower the required power (for example, from 90% to 80%), or accept a higher alpha with clear communication of the trade-offs.