Sample Proportion Calculator

p-hat Calculator

Turn a count of successes into the sample proportion p̂, with its standard error and confidence interval, and test it against a claimed value.

p̂ = x ÷ n

Enter the number of successes and the sample size

What Is p-hat?

p-hat (p̂) is the proportion of a sample that has some characteristic: the number of successes divided by the sample size. The hat marks it as an estimate of the unknown population proportion p.

On its own, p̂ is just a percentage. What makes it useful is knowing how far it might be from p. That comes from its standard error, √(p̂(1 − p̂) ÷ n), and the confidence interval built around it.

p̂ is also the starting point of the one-proportion z-test, which asks whether the sample is consistent with a claimed or historical value p₀.

p-hat Formula

As given in OpenStax Introductory Statistics, sections 8.3 and 9.6. See Sources.

1. Sample proportion

p̂ = x ÷ n · q̂ = 1 − p̂

2. Standard error

SE = √(p̂ q̂ ÷ n)

3. Test against a claimed p₀

z = (p̂ − p₀) ÷ √(p₀(1 − p₀) ÷ n)

The test uses p₀ in the standard error, because it asks how p̂ would behave if the claim were true.

Worked Example: Do More People Cycle Than the Council Says?

Given:
A survey finds 37 of 120 commuters cycle. The council's figure is 25%.
Step 1:
Sample proportion:
p̂ = 37 ÷ 120 = 0.3083
Step 2:
Standard error if the council is right:
√(0.25 × 0.75 ÷ 120) = 0.0395
Step 3:
Test statistic and p-value:
z = (0.3083 − 0.25) ÷ 0.0395 = 1.476 → p = 0.14
Result:
p̂ = 30.8%, 95% interval 23.3% to 39.6%

The survey hints at more cycling, but 25% sits inside the interval and p ≈ 0.14. 120 commuters isn't enough to overturn the council's figure.

p-hat Notation at a Glance

Symbols used with sample proportions
SymbolMeaningCycling example
xNumber of successes37
nSample size120
p̂Sample proportion0.3083
q̂Sample proportion of failures0.6917
pTrue population proportionUnknown
p₀Claimed value under test0.25

Common p-hat Mistakes

  • Confusing p̂ with the p-value. p̂ is a proportion from your data. The p-value is a probability from a test. They share a letter and nothing else.
  • Using p̂ in the test's standard error. The z-test uses p₀. Using p̂ gives a slightly different, non-standard statistic.
  • Dividing by the wrong total. If 8 of 120 people skipped the question, decide whether n is 120 or 112, and say which.
  • Testing with small expected counts. If n × p₀ is under 10, the z-test is unreliable; use an exact binomial test.

p-hat FAQs

How do you pronounce p̂?

“p-hat”. The hat (circumflex) is the usual mark for an estimate of a parameter.

Is p̂ the same as a percentage?

Yes, written as a decimal. p̂ = 0.3083 is 30.83%.

How do I get p̂ from a percentage?

Divide by 100. To recover the count, multiply p̂ by n and round: 30.8% of 120 is 37.

Why is the interval not symmetric around p̂?

The Wilson interval leans towards 50%, which keeps it inside 0–100% and gives more accurate coverage than p̂ ± 1.96 SE.

Is the test one-sided or two-sided?

Two-sided. For a one-sided test in the direction of the data, halve the p-value.

What is q̂?

The proportion of failures, 1 − p̂. It appears in the standard error formula as p̂q̂.

Can I compare two p̂ values?

Use the A/B test calculator, which runs a two-proportion z-test on two groups.

What sample size do I need?

For a target margin of error, use the sample size calculator. ±5 points at 95% needs about 385 responses.

Sources

Related Tools