p-hat Calculator (Sample Proportion)

Sample proportion p̂ = x/n with its standard error, margin of error and Wald and Wilson confidence intervals.

p̂ = x ÷ n. With 45 successes in 100 trials, p̂ = 0.45, SE = √(0.45 × 0.55 ÷ 100) = 0.0497, and the 95% confidence interval is 0.45 ± 1.96 × 0.0497 = 0.353 to 0.548.

Free, runs in your browser. Nothing you enter is uploaded.

How to use it

  1. Enter the number of successes x and the sample size n.
  2. Choose a confidence level (95% is usual).
  3. Read p̂, the standard error and the confidence intervals.

What you enter

What you get

Formula

p̂ = x/n | SE = √(p̂ q̂ / n) | CI = p̂ ± z* × SE

Worked example: survey

Input: 45 of 100 respondents agree, 95% confidence

Result: p̂ = 0.45; 95% CI 0.353 to 0.548

The true share could plausibly be anywhere from about 35% to 55%.

Questions

How do you find p-hat?

Divide the number of successes (people who said yes, defective items) by the total sample size: p̂ = x ÷ n.

What is the standard error of p-hat?

SE = √(p̂(1 − p̂) ÷ n). It shrinks as the sample grows.

What is the success-failure condition?

The normal approximation is reasonable when n·p̂ and n·(1 − p̂) are both at least 10.

Should I use the Wald or Wilson interval?

Wald (p̂ ± z·SE) is the textbook formula. Wilson is more accurate for small samples or proportions near 0 or 1, and is recommended by most statisticians.

References

More Statistics

All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.