Contents/ Part XXVIII · Capstone Projects: Sampling & Data Collection/ Chapter 177

A National Customer Study

Capstone 17. Sixty thousand customers, a budget for twelve hundred invitations, and an answer required to within three points. The project starts before any data exists and ends by showing exactly what the obvious answer would have got wrong.

โฑ๏ธ ~20 min read
๐ŸŽฏ Stratified sampling
๐Ÿ“Š Chapter 177

This capstone can do something none of the previous sixteen could. Because the population is simulated, the true answer is knowable, so we can run the analysis the way most surveys are actually run, and then check it against reality.

The brief
Setting
A retailer with 60,000 active customers commissioned a satisfaction survey. Twelve hundred invitations went out under a stratified design and 739 came back.
The question
What share of customers are satisfied, nationally and by region?
Why it matters
The figure goes into a board report and sets the retention budget for the year. A number that is confidently wrong is worse than no number at all.
What we do
Write the sampling plan before collecting anything, allocate the sample by Neyman's rule, analyze who did not respond, build post-stratification weights, and compare the weighted answer with the naive one against a known truth.
๐ŸŽฏ
Stratified sampling divides the population into groups and draws from each separately. It guarantees every group is represented, allows different sampling rates per group, and buys precision when the groups genuinely differ. The price is that unequal rates must be undone with weights before anything is reported.
โญ
The finding, up front

The naive respondent estimate is 63.5% would recommend, with a margin of error of 3.5 points. The truth is 58.4%. The naive interval does not merely miss it, it excludes it. Post-stratification recovers 60.6%, and that interval does contain the truth.

1

The Plan, Written Before Anything Was Collected

Five decisions, all made in advance and all recorded on the SamplingPlan sheet of the workbook. They are the reason this survey can be defended later.

StepDecisionConsequence
D1 PopulationAll 60,000 active retail customers on the registerDefines what the estimate is an estimate of
D2 FrameCustomers with a usable contact record: 55,4624,538 customers (7.6%) have zero chance of selection
D3 MethodStratified by region, Neyman allocationEstimates per region; unequal rates need weighting
D4 Size1,200 invited against 1,050 neededRealized precision 3.5 points, not the 3.0 requested
D5 InstrumentSix questions; region and age carried from the frameNon-response can be analyzed, not guessed at
The budget shortfall, stated in advance rather than discovered later

Reaching 1,050 usable responses at an expected 65 percent response rate needs about 1,616 invitations. The budget allowed 1,200. That is a legitimate decision, and the plan records it along with its cost: the survey will land near 3.5 points of precision rather than 3.0. A plan that quietly promises precision the budget cannot buy is worse than one that names the gap up front.

2

Where to Spend the Sample

Region is the stratum, because the business needs an estimate for each and because satisfaction genuinely differs between them. The interesting decision is how to split 1,200 invitations across the four.

RegionCustomersPilot SDProportionalNeyman (used)Shift
Northeast18,0001.25360353−7
Midwest14,0001.35280297+17
South20,0001.05400330−70
West8,0001.75160220+60

Proportional allocation feels fair and is not optimal. Precision is limited by where the variation is. A stratum whose members all answer alike needs few observations to pin down; a stratum whose members disagree needs more. Neyman allocation makes each stratum's share proportional to its size times its standard deviation.

So West, 13 percent of customers, takes 18 percent of the sample, because West customers disagree with each other more than anyone else (SD 1.75 against the South's 1.05). The South gives up 70 invitations because Southern customers are unusually consistent and cheap to estimate.

Left: grouped bars comparing proportional and Neyman allocation across four regions, with the West gaining 60 invitations and the South losing 70. Right: horizontal bars of response rates showing regions between 43 and 69 percent and age bands ranging from 34 percent for 18-34 to 84 percent for 55 plus.
Left: Neyman allocation moves sample toward the variable strata. Right: who actually replied. Note which comparison is starker: the spread across regions is 26 points, and the spread across age bands is 50.
3

The Instrument, and One Decision That Saves the Study

Customer study · the instrument as fielded
1
Which region do you live in?
Northeast / Midwest / South / West
Nominal · carried from the frame
2
Which age band are you in?
18-34 / 35-54 / 55+
Nominal · carried from the frame
3
How long have you been a customer?
Years, to one decimal
Continuous · numeric entry
4
Overall, how satisfied are you with our service?
1 Very dissatisfied234 Neutral567 Very satisfied
Ordinal · 7-point Likert
5
Would you recommend us to a friend or colleague?
Yes / No
Binary · the headline measure
6
What one thing would most improve our service?
Free response, optional
Open text
Why questions 1 and 2 are not really questions

Region and age band come from the frame, so we hold them for every customer we invited, whether or not they replied. That single choice is what makes the second half of this project possible.

Non-response can only be corrected using variables known for responders and non-responders. Ask for age on the questionnaire and you learn it only from people who answered, which is precisely the group you are trying to adjust away from. A variable you learn from the questionnaire can never be used to adjust for questionnaire non-response.

4

The Sample That Came Back Is Not the Sample We Drew

Cleaning removed two duplicate submissions and voided one out-of-range satisfaction code, leaving 739 usable responses from 1,200 invitations, a response rate of 61.6 percent. Respectable, and almost irrelevant on its own.

GroupInvitedRespondedRate
Northeast35323566.6%
Midwest29718261.3%
South33022768.8%
West2209543.2%
Age 18-3433511434.0%
Age 35-5447229762.9%
Age 55+39332883.5%

The regional gap was expected and the design had already allowed for it. The age gap is the dangerous one, and nothing in the design anticipated a fifty-point spread. Under-35s are 30 percent of customers and 15 percent of respondents. The 55+ band is 31 percent of customers and 44 percent of respondents. The pool that came back is far older than the customer base, and age is related to the answer.

5

The Naive Answer, and the Truth

Unweighted
63.46%
CI 59.9 to 66.9
Post-stratified
60.64%
CI 56.8 to 64.5
True value
58.41%
knowable only here
Naive error
+5.05 pp
interval excludes truth
Left: grouped bars of population versus respondent age composition, showing the 18-34 band under-represented by 14 points and the 55 plus band over-represented by 13. Right: two confidence intervals against a dashed line at the true value of 58.4 percent. The unweighted interval sits entirely to the right of the line; the post-stratified interval contains it.
Left: the composition failure. Right: what it does to the answer. The red interval is narrow, confident, and wrong; the green one is wider, less satisfying, and contains the truth.
PRECISION IS NOT ACCURACY, AND ONLY ONE OF THEM IS IN THE ARITHMETIC UNWEIGHTED tight group, wrong place 63.5% ± 3.5, truth 58.4% POST-STRATIFIED wider group, right place 60.6% ± 3.9, truth 58.4% weighting trades tightness for aim
The margin of error measures the size of the group, not the distance to the bullseye. Nothing computed from the respondents alone could have revealed the miss on the left, because every number in that calculation was correct. The only things that would have caught it are the composition check in section 4 and the design decision in section 3 that made the check possible.
The failure mode worth remembering

A badly composed sample does not announce itself with a wide interval and an honest shrug. It produces a narrow interval in the wrong place. This estimate is off by five points while reporting a margin of error of three and a half, and nothing in the arithmetic is incorrect. Precision and accuracy are different things, and a confidence interval only ever reports the first.

6

Weighting, and What It Costs

Post-stratification rebuilds the population shape by counting under-represented respondents for more than one person each. Weights come from the population region-by-age margins.

CellRespondentsWeightReading
South, 18-34212.83Each stands for nearly three average customers
Midwest, 18-34251.91Badly under-represented
Northeast, 35-54950.93About right
Midwest, 55+890.62Answered well above its share

The range of the weights is itself a diagnostic. Under five to one is workable. Ratios of twenty to one would mean a handful of respondents were carrying whole population segments, and the honest response would be to collect more data rather than to weight harder.

QuantityUnweightedPost-stratified
Estimate63.46%60.64%
Standard error0.01770.0197 (+12%)
Margin of error± 3.47 pp± 3.87 pp
Effective sample size739612 (design effect 1.21)
Error against truth+5.05 pp+2.23 pp

Weighting is not free, and the interval got wider rather than narrower. That surprises people and it is the correct behavior: unequal weights waste information, so 739 respondents carry the statistical weight of about 612 equally weighted ones. Weighting trades bias for variance, and here the trade removed 56 percent of the bias for a 12 percent wider standard error. Worth it, and not free.

7

What Weighting Could Not Reach

Two points of bias survive, and naming them precisely is the difference between a report and a sales pitch.

WHERE THE FIVE POINTS OF BIAS CAME FROM naive bias: +5.05 percentage points correctable: +2.8 pp age and region composition, known from the frame unreachable: +2.2 pp no weighting scheme can touch this coverage 4,538 customers never in the frame satisfaction happier customers replied more often Known for responders AND non-responders, so it can be weighted away. That is why D5 pulled them from the frame.
The split is the lesson. Age and region were correctable because the frame held them for everyone invited. Satisfaction cannot be corrected, because we know it only from the people who told us, and they are precisely the over-represented group. Coverage is the same problem one step earlier: those customers are not under-represented in the respondent pool, they are absent from the frame it was drawn from.
8

The Regional Estimates, Reported Honestly

RegionnWeighted estimate95% CITruthCovers?
Northeast23563.9%57.4% to 70.4%58.7%yes
Midwest18257.2%49.4% to 65.1%55.5%yes
South22763.8%56.7% to 70.9%66.2%yes
West9551.4%40.7% to 62.1%43.5%yes

All four regional intervals contain their true value, which is what a correctly specified procedure should deliver. They are also wide. The West rests on 95 respondents and its interval spans more than twenty points, which is the honest consequence of a stratum that is both small and reluctant. Nobody should rank these four regions confidently on this data, and the intervals are what stop them.

Satisfaction is reported as a top-two-box share rather than a mean, because the scale is ordinal: 48.4 percent in the South against 29.1 percent in West. Same discipline as Capstone 12, now applied to a survey we designed ourselves.

9

What to Watch

10

Sampling in Data Science & AI

Where it appearsThe same problem, renamed
Training data compositionThe training set is a respondent pool. Which groups replied, and which are the 18-34 band?
Importance weightingPost-stratification under another name, with the same limitation: it fixes what you weighted on
Effective sample sizeKish's neff reappears whenever examples are weighted or resampled
Feedback loopsYou observe only users the current system serves well. Non-response with a different name
Practice note

Importance weighting to correct dataset shift is exactly the procedure in section 6, and it inherits exactly the same constraint: it can only correct on variables you observe in both the training and deployment distributions. The unmeasured driver, the analog of satisfaction here, stays uncorrected. When a reweighted model still underperforms on a subgroup, the usual explanation is not that the weighting was done badly but that the variable driving the shift was never in the data to weight on.

๐Ÿ

The full project, step by step

The companion notebook runs the five design steps before touching data: it quantifies the coverage shortfall, derives the sample size from the required precision, compares proportional against Neyman allocation, and prints the instrument. It then cleans the returned file, breaks response rates down by region and age, computes the naive estimate, builds post-stratification weights, reports the Kish effective sample size, and closes by comparing both estimates against the true population value.

๐Ÿ““ View Notebook (code & outputs) โ–ถ Open in Colab โฌ‡ View / Download on GitHub
Read the reports & get the data

The dataset (capstone-stratified-customer-survey.xlsx) holds all 1,200 invited customers rather than only the ones who replied, which is what makes non-response analysis possible, plus the written sampling plan, the questionnaire, the frame summary, the population margins for weighting, and the true population values. Two written reports accompany it: a plain-language brief for an insight lead, and a technical report covering the allocation, the weighting and the residual bias.

๐ŸŽ“ Key Takeaways

  • โœ“A narrow interval in the wrong place is what a badly composed sample produces. The naive estimate was 5 points out while reporting a margin of error of 3.5.
  • โœ“Carry weighting variables from the frame. Anything learned from the questionnaire is useless for correcting questionnaire non-response.
  • โœ“Neyman allocation buys precision by sampling variable strata harder, and charges for it in unequal weights later.
  • โœ“Weighting trades bias for variance. It removed 56% of the bias and widened the standard error by 12%; 739 respondents became an effective 612.
  • โœ“The response rate tells you almost nothing. 61.6% looked fine. What mattered was that the 18-34 band answered at 34% and the 55+ band at 84%.
11

Quiz: Test Yourself

Eight questions on designing, fielding and weighting a survey. Answer them, hit Check Answers, and keep refining until you score 100%. Your progress is saved.