Lesson 4 of 7 · 15 min

The sample proportion as a random variable

Calculate the sample proportion p^=X/n\hat{p} = X/n, see why it varies from sample to sample, and find its exact distribution for small samples from the binomial distribution.

What you will be able to do

  • Calculate a sample proportion p^=Xn\hat{p} = \frac{X}{n}.
  • Explain why p^\hat{p} is a random variable while pp is a fixed parameter.
  • List the possible values of p^\hat{p} and find exact probabilities using X∼Bin(n,p)X \sim \mathrm{Bin}(n, p).

Suppose 30 % of Queensland adults drink coffee every day — so p=0.3p = 0.3. A researcher surveys a random sample of 50 adults and finds 17 daily coffee drinkers: a sample proportion of 1750=0.34\frac{17}{50} = 0.34. A second researcher surveys a different 50 and finds 13, or 0.260.26. Neither has done anything wrong. Different random samples give different proportions.

Definition

The sample proportion

If XX members of a random sample of size nn have an attribute, the sample proportion is

p^=Xn.\hat{p} = \frac{X}{n}.

Before the sample is taken, XX is a random variable, so p^\hat{p} is a random variable too. Its value varies from sample to sample. The population proportion pp is a parameter: one fixed number.

In a random sample of 240 Brisbane commuters, 78 travel to work by bus. Calculate the sample proportion of bus commuters.

Interactive

Take sample after sample

Draw one sample at a time, then many. Where do the values of p^\hat{p} cluster? Now change nn to 200: what happens to the spread?

Each sample adds one value of p^\hat{p} to the display. After hundreds of samples, the display shows the sampling distribution of p^\hat{p}: the pattern of values it takes over all possible samples. Two things stand out. The values cluster around p=0.3p = 0.3, and the cluster is narrower for larger samples.

Key idea

The exact distribution of p̂

In a random sample from a large population, each member independently has the attribute with probability pp, so the count is binomial: X∼Bin(n,p)X \sim \mathrm{Bin}(n, p). Then p^=Xn\hat{p} = \frac{X}{n} takes the values

0,1n,2n,…,1,withP ⁣(p^=kn)=P(X=k)=(nk)pk(1−p)n−k.0, \frac{1}{n}, \frac{2}{n}, \dots, 1, \qquad\text{with}\qquad P\!\left(\hat{p} = \frac{k}{n}\right) = P(X = k) = \binom{n}{k} p^k (1-p)^{n-k}.

So any probability about p^\hat{p} is a probability about XX: translate the proportion into a count by multiplying by nn.

Strictly, sampling without replacement from a finite population makes the trials slightly dependent. When the population is much bigger than the sample (a common guide is at least 10 times bigger), the binomial model is an excellent approximation, and that is the situation in this topic.

Worked example

The exact distribution of p̂ for a small sample

  • Complex familiar

Suppose 30 % of the trees in a large plantation carry a particular fungus. A forester inspects a random sample of 5 trees and records the sample proportion p^\hat{p} of infected trees.

(a) List the possible values of p^\hat{p}.

(b) Find the probability distribution of p^\hat{p}, correct to four decimal places.

(c) Find P(p^≥0.6)P(\hat{p} \ge 0.6).

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Write X∼Bin(n,p)X \sim \mathrm{Bin}(n, p) for the count and p^=Xn\hat{p} = \frac{X}{n}.

  2. Convert each statement about p^\hat{p} into one about XX by multiplying by nn.

  3. Use the binomial formula (or a calculator's binomial PD and CD functions).

Watch out for

  • Treating the six values of p^\hat{p} as equally likely.

  • Adding the rounded probabilities: use exact values and round at the end.

A random sample of 5 people is taken from a large population in which 40 % of people own a cat. Calculate P(p^=0.6)P(\hat{p} = 0.6).

Common mistake

Mixing up p and p̂

pp is the population proportion: fixed, usually unknown, and the thing you want to know. p^\hat{p} is what you calculate from your sample, and it would change if you sampled again. When you write a probability statement, it is always about p^\hat{p} (or XX), never about pp.

Tip

Proportions and counts

Inequalities translate the same way: with n=20n = 20, "p^≥0.25\hat{p} \ge 0.25" means "X≥5X \ge 5", and "p^<0.25\hat{p} < 0.25" means "X≤4X \le 4". Take care with strict and non-strict inequalities, because XX only takes whole-number values.

Summary

  • p^=Xn\hat{p} = \frac{X}{n} is the proportion of the sample with the attribute.

  • p^\hat{p} is a random variable — it varies between samples; pp is a fixed parameter.

  • For a random sample, X∼Bin(n,p)X \sim \mathrm{Bin}(n, p), so P(p^=kn)=P(X=k)P(\hat{p} = \frac{k}{n}) = P(X = k).

  • Simulated values of p^\hat{p} cluster around pp, more tightly for larger samples.

Finished the lesson?

Try the 2 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 4 of 70% read

Save your progress with a free account