03 / Data foundations
Sampling, surveys and representative measurement
A sampling plan connects the records you can collect to the population you want to understand. Selection, coverage, response and weighting matter before the sample size is considered.
The business question
Whose experience does the sample represent?
- Estimate service quality without contacting every customer.
- Compare branches or customer groups while preserving their representation.
- Design a manageable data-collection exercise that supports a defined business decision.
How the method works
Write the target population in operational terms: for example, all completed repair customers in a stated quarter. Build a sampling frame that can reach those customers and choose a probability-based selection method when population inference is the aim. A random number does not repair a frame that excludes customers who lack email addresses or whose complaints were never recorded.
A simple random sample gives eligible units a known chance of selection. Stratification divides the population into meaningful groups, such as branches, before sampling within them. It can ensure a small group is represented, but equal samples from unequal groups change the sample mix. To estimate a population total or proportion, apply weights that reflect the inclusion design and any defensible response adjustment.
Sampling error is only one uncertainty. Non-response, confusing wording, recall error and measurement inconsistency can bias a large sample. Track invitations, replies and respondent characteristics rather than reporting only the number of answers. For clustered or heavily weighted designs, use uncertainty calculations that respect the design; an ordinary independent-observation formula may overstate precision.
The calculation
| Symbol | Meaning |
|---|---|
| h | A population stratum, such as a branch. |
| Nₕ, nₕ | Population and sampled counts in that stratum. |
| Wₕ | Share of the target population belonging to the stratum. |
| p̂ₕ | Observed outcome proportion within that stratum. |
A worked business example
ILLUSTRATIVE SCENARIO
Illustrative two-branch repair company: branch A serves 600 of 1,000 eligible customers and B serves 400. Fifty customers are randomly sampled from each branch and all respond.
Inputs
- Branch A: 40 satisfied respondents out of 50.
- Branch B: 25 satisfied respondents out of 50.
- Population shares: A = 0.60; B = 0.40.
Work through the numbers
- Calculate the within-branch satisfaction rates: A = 40/50 = 80%; B = 25/50 = 50%.
- An unweighted pooled calculation gives 65/100 = 65%, but it assigns each branch a 50% share.
- Use population shares: 0.60 × 0.80 + 0.40 × 0.50 = 0.68.
- Equivalently, use expansion weights 600/50 = 12 and 400/50 = 8: (40 × 12 + 25 × 8)/1,000 = 68%.
The weighted estimate restores the known branch population mix under the stated selection and full-response assumptions. It does not prove that nonrespondents would have answered similarly if response were incomplete.
Explore the decision
Plan a simple random survey. The live explorer has its own example inputs; it is separate from the worked calculation above.
Enable JavaScript to use this calculator. The worked example and executable Python remain available.
Apply it at work
- Define the population, reporting period, sampling unit and business measure.
- Choose a reachable frame and a documented random selection design, including any strata.
- Record invitations, responses and design weights; keep question wording and collection conditions consistent.
- Estimate outcomes with appropriate weights and uncertainty, then assess coverage and response limitations.
Check these assumptions
- Population counts and stratum membership are accurate for the reporting period.
- Selection within each example stratum is genuinely random and without substitution by convenience.
- The numerical example assumes full response; non-response requires a separate assessment.
- The outcome question has the same meaning across branches and customer groups.
Common mistakes and how to avoid them
- A large voluntary website poll can still miss unhappy customers who stopped using the service.
- Weights repair the intended sample mix, not every unobserved difference between respondents and nonrespondents.
- Selecting every twentieth record can be distorted if the file has a repeating pattern aligned with that interval.
How this can help the business
- A business can avoid changing its offer based only on its most vocal or easiest-to-reach customers.
- Separate group estimates can direct investigation while the weighted total provides a coherent company-wide measure.
Use population conclusions only when the selection, coverage and response story support them; report subgroup and design limitations alongside the estimate.
When to use another approach
Use a census for a small accessible population, or treat a convenience sample as exploratory rather than representative.
Reproduce the worked example in Python
The code is self-contained for this example. Dependencies and run instructions are included with the downloadable notebook.
Show executable code and recorded output
population_a, population_b = 600, 400
satisfied_a, sampled_a = 40, 50
satisfied_b, sampled_b = 25, 50
rate_a = satisfied_a / sampled_a
rate_b = satisfied_b / sampled_b
weighted = (population_a*rate_a + population_b*rate_b)/(population_a+population_b)
unweighted = (satisfied_a+satisfied_b)/(sampled_a+sampled_b)
print(f'Branch A: {rate_a:.1%}; branch B: {rate_b:.1%}')
print(f'Population-weighted rate: {weighted:.1%}')
print(f'Unweighted sample rate: {unweighted:.1%}')Recorded output
Branch A: 80.0%; branch B: 50.0% Population-weighted rate: 68.0% Unweighted sample rate: 65.0%
Sources and further reading
Concepts are linked to primary teaching or technical sources. The business examples are illustrative applications, not reported client results.