# Sample size and power calculator

> Sample size calculator for surveys and studies: n for a margin of error on a proportion or mean, and the per-group n for a target power.

ইন্টারঅ্যাকটিভ সংস্করণ: https://www.calcopenly.com/bn/statistics/sample-size-calculator
বিষয়: পরিসংখ্যান ও সম্ভাবনার ক্যালকুলেটর

For a survey proportion the sample size is n₀ = z²p(1 − p)/E², where z is the critical value for the confidence level and E the margin of error; for a mean it is (zσ/E)². A known population size N reduces this through the finite population correction, n = n₀/(1 + (n₀ − 1)/N). To compare two means, each group needs 2(z₁₋α/₂ + z₁₋β)²/d², where d is the difference to detect divided by σ.

Survey planners and researchers use it before collecting data. The default, 95% confidence and ±5 points with p = 50%, needs 384.1 respondents, rounded up to 385; for a population of 10,000 the correction lowers that to 370.

Results are always rounded up. The formulas assume simple random sampling; cluster samples, weighting and non-response all call for a larger sample.

## ইনপুট

- **Plan for** (বিকল্প: Estimating a proportion (survey), Estimating a mean, Comparing two means (power))
- **Confidence level**
- **Expected proportion**: Use 50% when you have no prior estimate — it gives the largest, safest sample.
- **Margin of error**: In percentage points: 5 means ±5%.
- **Standard deviation σ (estimate)**: From a pilot study or earlier data.
- **Margin of error (same units as σ)**
- **Population size**: Applies the finite population correction.
- **Difference to detect δ**: The smallest difference between the group means worth detecting.
- **Significance level α**
- **পরিসংখ্যানগত ক্ষমতা**
- **Test** (বিকল্প: Two-sided, One-sided)

## ফলাফল

- Sample size needed — প্রধান ফলাফল
- Before rounding up
- Without population correction
- Total across both groups
- Effect size d = δ/σ
- z for the confidence level or α

## সূত্র

$$
n_0 = \frac{z^2\,p(1-p)}{E^2},\quad n_0 = \left(\frac{z\sigma}{E}\right)^2,\quad n = \frac{n_0}{1 + (n_0-1)/N},\quad n_{\text{group}} = \frac{2(z_{1-\alpha/2} + z_{1-\beta})^2\sigma^2}{\delta^2}
$$

## সমাধান করা উদাহরণ

### Survey at 95%, ±5%, p = 50% (defaults)

- Plan for: Estimating a proportion (survey)
- Confidence level: 95%
- Expected proportion: 50%
- Margin of error: 5%
- **Sample size needed: 385**
- **Before rounding up: 384.1459**
- যাচাইয়ের উৎস: Cochran's formula 1.959964² × 0.25 / 0.05² = 384.146 (Python NormalDist); the widely published figure is 385

### Same survey, population of 10,000

- Plan for: Estimating a proportion (survey)
- Confidence level: 95%
- Expected proportion: 50%
- Margin of error: 5%
- Population size: 10,000
- **Sample size needed: 370**
- **Before rounding up: 369.9706**
- যাচাইয়ের উৎস: Finite population correction n₀/(1 + (n₀ − 1)/N) in Python

### Small population of 100

- Plan for: Estimating a proportion (survey)
- Confidence level: 95%
- Expected proportion: 50%
- Margin of error: 5%
- Population size: 100
- **Sample size needed: 80**
- **Before rounding up: 79.5093**
- যাচাইয়ের উৎস: Finite population correction in Python: 384.146/(1 + 383.146/100)

### Mean within ±3 when σ = 15

- Plan for: Estimating a mean
- Confidence level: 95%
- Standard deviation σ (estimate): 15
- Margin of error (same units as σ): 3
- **Sample size needed: 97**
- **Before rounding up: 96.0365**
- যাচাইয়ের উৎস: (1.959964 × 15 / 3)² = 96.04 in Python

### Power 80% for d = 0.5, two-sided α = 0.05

- Plan for: Comparing two means (power)
- Standard deviation σ (estimate): 15
- Difference to detect δ: 7.5
- Significance level α: 0.05
- পরিসংখ্যানগত ক্ষমতা: 80%
- Test: Two-sided
- **Sample size needed: 63**
- **Before rounding up: 62.791**
- **Total across both groups: 126**
- **Effect size d = δ/σ: 0.5**
- যাচাইয়ের উৎস: Normal approximation 2(1.959964 + 0.841621)²/0.25 in Python; Cohen's t-based table gives 64 per group

### 99% confidence, ±1%

- Plan for: Estimating a proportion (survey)
- Confidence level: 99%
- Expected proportion: 50%
- Margin of error: 1%
- **Sample size needed: 16,588**
- **Before rounding up: 16,587.2**
- যাচাইয়ের উৎস: 2.575829² × 0.25 / 0.0001 = 16587.24 (Python NormalDist)

## প্রশ্ন

### Why is 385 the standard survey sample size?

It is what Cochran's formula gives for 95% confidence, a ±5-point margin and p = 50%: 1.96² × 0.25 / 0.05² = 384.1, rounded up to 385. Because p = 50% is the worst case, 385 is enough for any true proportion in a large population. A population of 1,000 needs only 278, because each respondent is a larger share of it.

### Does population size matter for sample size?

Only when the sample is a noticeable fraction of the population. The finite population correction turns the 385 needed for ±5 points at 95% into 370 for a population of 10,000 and 80 for a population of 100, while any population above 100,000 needs 383 to 385. A sample of 1,000 gives about ±3.1 points whether the population is 100,000 or 300 million.

### What expected proportion should I use?

Use 50% unless you have a reliable prior estimate. p(1 − p) is largest at p = 0.5, so that sample is big enough whatever the true value turns out to be. A prior estimate lowers the requirement: at 95% confidence and ±5 points, an expected 20% needs 246 respondents instead of 385. If the guess is wrong, the achieved margin will be wider than planned.

### How does sample size change with the margin of error?

The margin shrinks with the square root of n, so halving it needs four times the sample. At 95% confidence and p = 50%, ±5 points needs 385 respondents, ±3 points 1,068, ±2 points 2,401 and ±1 point 9,604. Choosing 90% confidence instead of 95% lowers the ±5-point figure to 271.

### What does statistical power mean?

Power is the probability that a test detects an effect of a stated size when that effect is real; 1 − power is the Type II error rate β. Cohen (1988) proposed 80% as a conventional minimum. Detecting a difference of 7.5 when σ = 15 (d = 0.5) with a two-sided test at α = 0.05 needs 63 per group for 80% power by the normal approximation; Cohen's t-based table gives 64.

### “Sample size and power calculator” কতটা নির্ভুল?

নির্ভুলতা আপনার ইনপুট ও পদ্ধতির অনুমানের ওপর নির্ভর করে। দশমিক গণনায় 50টি সার্থক অঙ্ক ব্যবহৃত হয়, কিন্তু আনুমানিক হিসাব, সংখ্যাগত পদ্ধতি ও উৎসের তথ্য কম নির্ভুল হতে পারে; প্রদর্শিত মান রাউন্ড করলে এই সীমাবদ্ধতাগুলি দূর হয় না। স্বতন্ত্র উৎসের সমাধানের সঙ্গে যাচাই করা উদাহরণ: ৬। যেমন, “Survey at 95%, ±5%, p = 50% (defaults)” উদাহরণটি Cochran's formula 1.959964² × 0.25 / 0.05² = 384.146 (Python NormalDist); the widely published figure is 385-এর সঙ্গে যাচাই করা হয়।

### এই পদ্ধতির উৎস কী?

NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.2.2 Sample sizes required; Cochran, W. G. (1977). Sampling Techniques, 3rd ed., §4.4 (sample size for proportions and the finite population correction); Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences, 2nd ed., Table 2.4.1.

## উৎস

- [NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.2.2 Sample sizes required](https://www.itl.nist.gov/div898/handbook/prc/section2/prc222.htm)
- Cochran, W. G. (1977). Sampling Techniques, 3rd ed., §4.4 (sample size for proportions and the finite population correction)
- Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences, 2nd ed., Table 2.4.1
