# Sample Size

**Category:** metrics  
**Short Description:** The number of observations in a sample, critical for the accuracy and reliability of statistical estimates.  
**Last Updated:** 2024-03-20T11:00:00Z

## Definition

Sample size refers to the number of observations or data points collected in a sample, and is a crucial factor in determining the precision of statistical estimates. In advertising, it directly impacts the confidence, reliability, and validity of metrics such as conversion rates, click-through rates, and return on ad spend (ROAS). The larger the sample size, the more reliable the results, as smaller samples can lead to more variability and less confidence in the conclusions drawn from the data.

## Formula

**Formula:** `n = (Z² × σ²) / E²`

How many observations you need: more variable data (σ) or a tighter precision target (E) both demand a larger sample, while higher confidence (Z) raises it too.

## Calculation

**Formula:** `n = (Z² * σ²) / E²`

**Explanation:** The sample size formula calculates the minimum number of observations required to achieve a specified confidence level and margin of error. Here, Z represents the Z-score corresponding to the desired confidence level, σ² is the population variance, and E is the margin of error. Larger sample sizes reduce the margin of error, leading to more precise estimates of population parameters.

### Components

- **Confidence Level**: The degree of certainty you want in your results (e.g., 95% confidence)
- **Margin of Error**: The allowable deviation from the true population value, often expressed as a percentage
- **Population Variance**: A measure of how much variability exists in the population being sampled

## Examples

- To estimate a 5% conversion rate with a ±1% margin of error at 95% confidence, you would need 10,000 impressions.
- Achieving statistical significance in A/B testing might require 5,000 samples per variant to detect a 1% difference in CTR.
- In a brand awareness study, a sample size of 1,200 respondents is required to achieve 95% confidence with a 3% margin of error.

## Related Terms

### Component Terms

- **[Margin of Error](/resources/glossary/metrics/margin-of-error)**: Sample size directly impacts the margin of error, with larger sample sizes leading to more precise estimates.
- **[Variance](/resources/glossary/metrics/variance)**: Sample size directly impacts the variance, with larger sample sizes leading to more precise estimates.

## Related Resources

- [Statistical Noise: Unmasking the Illusion of Insights in Modern Marketing](/blog/topics/data-science/statistical-noise-unmasking-the-illusion-of-insights-in-modern-marketing) - Comprehensive exploration of how sample size affects statistical reliability in marketing data

## Featured in topic hubs

- [Experimentation & Statistics](/resources/topics/experimentation)
