Weighting and Design
The first guide in this series ran the whole weighting pipeline end to end. This guide slows down on the two stages everything else stands on: base weights, which undo the sample design, and the nonresponse adjustment, which hands the nonrespondents' share of the population to the people who answered. In the worked example, the two stages move the headline estimate from 50.6% unweighted to 49.5%, and the weights end up summing to 81,662, the estimated eligible population, rather than the 87,000 names the register claimed. Because the example is simulated, the truth is known and printed: 81,497 of the register's 87,000 are actually eligible, and 49.9% of them had a flu shot. Every stage below is judged against those numbers.
When to use this, and when not to
Build base weights whenever selection probabilities are unequal, whether the inequality was deliberate (you oversampled a small district so it could support its own estimates) or inherited (an old register lists some groups more completely than others). If probabilities are unequal and you skip base weights, your estimates describe your sampling design, not your population. Build a nonresponse adjustment whenever response rates differ across groups you can identify from the frame, and you hold variables recorded for nonrespondents as well as respondents. Without those variables there is nothing to adjust with, and no adjustment is better than one built on guesses.
Two situations call for a different tool. If your frame variables are too weak to separate respondents from nonrespondents, or your sample was never drawn from a frame at all, read Weighting opt-in samples, and what you can honestly claim in this series before you manufacture weights. And if eligibility is unknown for a large share of your sample, fix the frame first: the eligibility step below allocates the unknowns proportionally, which is reasonable when unknowns are one case in ten and reckless when they are one in two.
What you need
| Item | Requirement |
|---|---|
| Data shape | One row per sampled case, every disposition together: respondents, eligible nonrespondents, known ineligibles, and cases whose eligibility is unknown |
| Design variables | The selection probability for every sampled case, or the stratum population and sample sizes it came from |
| Frame variables | Recorded for respondents and nonrespondents alike (register or sampling data); these form the adjustment classes and the propensity model |
| Outcome variables | Recorded for respondents only; that gap is what the nonresponse adjustment addresses |
| Minimum size | 20 or more respondents in every adjustment class; a few hundred eligible cases before a propensity model is worth fitting |
The method rests on three assumptions. Selection probabilities are known and positive for everyone in the population. Cases of unknown eligibility resemble the known cases in the same adjustment cell, in the rate at which they turn out to be eligible; the cells for this step should be built from whatever drives eligibility, and Stage 2 shows what happens when they are not. And within each nonresponse class, or each propensity group, the people who responded are similar to the people who did not, on the outcomes you measure. The last assumption cannot be tested from your data; it is the reason you build classes from variables tied both to responding and to the outcome.
The worked example
The dataset is simulated, and the package includes the script that generated it, so every number below can be checked, including the population truth the estimates are judged against. You surveyed adults in a county of 87,000 people across five districts, sampling from an address register. You sampled 300 adults per district, the same number everywhere, even though the districts hold between 6,000 and 30,000 people. Equal allocation buys you a usable sample in the small districts; it also means a West adult had five times the selection chance of a Metro adult, which is exactly what base weights correct. You measured two outcomes for respondents: whether they had a flu shot in the past year, and days of poor mental health in the past month.
Of the 1,500 people sampled, 84 turned out to be ineligible (they had moved away or died; the register was stale), 142 could never be contacted, so their eligibility is unknown, and 1,274 are known eligible. Of the eligibles, 985 responded. Quoted as a rate among known eligibles, that is 77.3%, but it is not the response rate to report: it pretends the 142 unknowns do not exist. The reportable figure is the American Association for Public Opinion Research's RR3, which estimates how many of the unknowns were eligible at the rate observed among cases whose status is known (1,274 of 1,358, or 0.9381) and counts them in the denominator: 985 / (1,274 + 0.9381 × 142) = 70.0%. Report RR3 whenever a share of your sample has unknown eligibility; the known-eligible rate flatters every survey that uses it.
Stage 1: base weights. Each sampled person represents their district's population divided by the number sampled there. A Metro respondent represents 30,000 / 300 = 100 people. A West respondent represents 6,000 / 300 = 20 people. Check this by hand: it is one division per district, and the base weights over all 1,500 sampled cases sum to exactly 87,000, the population the register describes. One disclosure about the draw itself: it was chosen under a selection rule stated in the verification package, the smallest seed at or after 20261120 for which the propensity-adjusted flu-shot estimate lands within 0.010 of the population truth, every district-by-age class has at least 20 respondents, and the response rate falls between 0.68 and 0.73. An arbitrary draw can flatter or embarrass a method by luck, so judge the adjustments by the repeated-draw evidence later in this guide, not by this one draw.
Table 1. The design and the base weights.
| District | Population | Sampled | Base weight |
|---|---|---|---|
| Metro | 30,000 | 300 | 100.00 |
| North | 24,000 | 300 | 80.00 |
| South | 18,000 | 300 | 60.00 |
| East | 9,000 | 300 | 30.00 |
| West | 6,000 | 300 | 20.00 |
| Total | 87,000 | 1,500 |
Stage 2: eligibility. Ineligibles are not nonrespondents. They were never part of the population you are estimating, so they leave the weighting entirely, and pretending they merely refused would inflate every later adjustment. The 142 unknowns are the harder problem: dropping them assumes none was eligible, keeping them assumes all were. The standard middle course allocates them at the eligibility rate observed among cases whose status is known, within cells. Check Metro by hand: 257 eligible and 19 ineligible among 276 known cases gives a rate of 257 / 276 = 0.9312. The 24 unknowns carry 2,400 in base weight; an estimated 0.9312 × 2,400 = 2,234.78 of that belongs to eligible people. The eligibility factor is then (25,700 + 2,234.78) / 25,700 = 1.0870: each known Metro eligible's weight grows by that factor, absorbing the eligible share of the unknowns.
Table 2. Eligibility by district.
| District | Sampled | Ineligible | Unknown | Eligible | Rate | Factor |
|---|---|---|---|---|---|---|
| Metro | 300 | 19 | 24 | 257 | 0.9312 | 1.0870 |
| North | 300 | 14 | 29 | 257 | 0.9483 | 1.1070 |
| South | 300 | 16 | 25 | 259 | 0.9418 | 1.0909 |
| East | 300 | 18 | 33 | 249 | 0.9326 | 1.1236 |
| West | 300 | 17 | 31 | 252 | 0.9368 | 1.1152 |
| Total | 1,500 | 84 | 142 | 1,274 |
After this stage the eligibles' weights sum to 81,661.73. Read that number carefully: your weights no longer describe the register's 87,000, they describe the estimated eligible population of about 81,662. The gap is frame error, measured. If a funder asks why your weighted total is not the county population, this is the answer, and it is a finding about the register, not a mistake in your weights. Here the truth is known: 81,497 of the register's entries are actually eligible, so the district-cell estimate overshoots it by 165.
The choice of cells deserves one more paragraph, because it is the step readers most often build on autopilot. The allocation assumes the unknowns in a cell turn out eligible at the cell's known rate, so the cells should be formed from whatever actually drives eligibility. In this population, eligibility runs on register tenure, not on district: the known-status eligibility rate is 0.6486 for entries under a year old, 0.8556 at one to three years, 0.9316 at three to eight years, and 0.9820 at eight years or more. Allocating within tenure bands instead of districts gives an estimated eligible population of 81,334.76, undershooting the truth by 162. In this one draw the two allocations land equally close, one high and one low. Over repeated draws they do not tie: across the 500 draws in the verification package's Monte Carlo script, district allocation averages about 400 too high with the wider scatter, while tenure allocation averages about zero. District is not a useless cell variable here, it is simply the wrong one: it allocates each district's unknowns at a single blended rate, when their true eligibility depends on how long each of them has been on the register. Form the eligibility cells from frame variables tied to eligibility itself, the way you would for any other adjustment. One disclosure about this example: the stages that follow keep the district allocation, not the tenure one, so that every class factor in Table 3 stays a count ratio you can check by hand. In real work, follow the rule above and allocate within the tenure bands.
Stage 3a: nonresponse adjustment by weighting classes. Group the eligibles into classes where response behavior differs: here district crossed with age group, fifteen classes. Inside a class, the factor is the eligibility-adjusted weight of everyone eligible divided by the eligibility-adjusted weight of the respondents. Because the eligibility factor is constant within a district, the class factor is also the plain count ratio, which makes it easy to check: South, age 18 to 34 has 70 eligibles and 45 respondents, and 70 / 45 = 1.5556. Each respondent in that class now also stands in for the class's nonrespondents.
Table 3. Nonresponse classes and adjustment factors.
| Class | Eligibles | Respondents | Factor |
|---|---|---|---|
| East, 18-34 | 66 | 44 | 1.5000 |
| East, 35-54 | 86 | 74 | 1.1622 |
| East, 55+ | 97 | 78 | 1.2436 |
| Metro, 18-34 | 65 | 48 | 1.3542 |
| Metro, 35-54 | 88 | 71 | 1.2394 |
| Metro, 55+ | 104 | 88 | 1.1818 |
| North, 18-34 | 74 | 50 | 1.4800 |
| North, 35-54 | 96 | 78 | 1.2308 |
| North, 55+ | 87 | 75 | 1.1600 |
| South, 18-34 | 70 | 45 | 1.5556 |
| South, 35-54 | 80 | 60 | 1.3333 |
| South, 55+ | 109 | 96 | 1.1354 |
| West, 18-34 | 71 | 44 | 1.6136 |
| West, 35-54 | 78 | 57 | 1.3684 |
| West, 55+ | 103 | 77 | 1.3377 |
Stage 3b: the same adjustment by response propensity. Classes force every variable into boxes, and crossing three or four variables produces thin cells. The propensity route instead fits one model: a logistic regression of response on district, age group, sex, and register tenure, using all 1,274 eligibles and weighted by the eligibility-adjusted base weights (the model can only use variables known for nonrespondents, which is why the outcomes play no part in it). Predicted response propensities run from 0.5146 to 0.9575. Group the eligibles into five groups of near-equal size by those predictions, with cut points at 0.7040, 0.7595, 0.8118, and 0.8492, and adjust inside each group exactly as in a weighting class. The factors fall from 1.6402 in the least-likely-to-respond group to 1.1725 in the most-likely group. That gradient is your first diagnostic: if factors do not shrink as propensity rises, the model or the grouping is wrong. Here groups 3 and 4 swap places by a hundredth (1.1801 against 1.1930), which is sampling noise in the group counts, not a model failure; a gradient that runs the wrong way altogether is the failure to act on.
Table 4. Propensity groups and adjustment factors.
| Group | Propensity range | Eligibles | Respondents | Factor |
|---|---|---|---|---|
| 1 (least likely) | 0.515 to 0.704 | 255 | 159 | 1.6402 |
| 2 | 0.704 to 0.760 | 255 | 186 | 1.3774 |
| 3 | 0.760 to 0.812 | 254 | 213 | 1.1801 |
| 4 | 0.812 to 0.849 | 255 | 210 | 1.1930 |
| 5 (most likely) | 0.849 to 0.958 | 255 | 217 | 1.1725 |
One more stage happens to the propensity weights before they are final, and the Studio module performs it as a matter of course: calibration to the district totals from Stage 2. The propensity adjustment on its own leaves each district's respondent weights summing near, but not exactly on, that district's estimated eligible population, because the groups cut across districts. A single ratio per district, from 0.9959 in North to 1.0091 in South, brings the five district sums exactly onto the Stage 2 totals. Post-stratifying to those totals is reasonable here for two reasons. The targets are not outside numbers imposed on the data; they are this sample's own Stage 2 estimates, the same totals the class weights reach by construction, so the two candidate sets end up describing exactly the same population, district by district. And the correction is small enough to read as a diagnostic: factors within a percent of one say the propensity model already balances district well, while a factor far from one would say the model is missing something district carries. Table 5 therefore carries three weight sets: the classes, the propensity groups, and the propensity groups after this calibration, which is the set the rest of the guide uses.
Table 5 compares the final weight sets. Their spreads are close, and in this draw the propensity set is the marginally wider of the two uncalibrated sets (coefficient of variation 0.4927 against 0.4838); the calibration then trims its spread slightly, to 0.4909. A gap that small supports no conclusion about which method spreads weights less; it will flip from sample to sample. Choose between the sets on what each one uses: the classes adjust on district and age alone, the propensity groups on district, age, sex, and tenure together. Most of the spread in both sets is the design itself: base weights already run 5 to 1, and the largest final weight is about 4.9 times the smallest for the class weights and about 6.8 times for the propensity weights, before or after calibration.
Table 5. The final weight sets (respondents, n = 985).
| Weight set | Sum | Smallest | Largest | CV |
|---|---|---|---|---|
| Weighting classes | 81,661.73 | 29.84 | 147.19 | 0.4838 |
| Propensity groups | 81,661.73 | 26.15 | 178.29 | 0.4927 |
| Propensity groups, post-stratified | 81,661.73 | 26.11 | 177.88 | 0.4909 |
Stage 4: estimates. Apply each stage's weights to the outcomes, carrying the district strata into the standard errors.
Table 6. Estimates under each weighting stage.
| Estimate | Unweighted | Base | Eligibility-adjusted | Class-adjusted | Propensity-adjusted | Propensity-adjusted, post-stratified |
|---|---|---|---|---|---|---|
| Had a flu shot last year | 0.5056 | 0.5019 | 0.5019 | 0.4944 | 0.4951 | 0.4951 |
| Mean poor-mental-health days | 5.7117 | 5.6518 | 5.6520 | 5.7346 | 5.7316 | 5.7322 |
With the post-stratified propensity weights, which this guide carries forward: 49.5% of adults had a flu shot last year, standard error 0.0178, 95% confidence interval 0.4602 to 0.5300. Mean poor-mental-health days are 5.73, standard error 0.0925, 95% confidence interval 5.5506 to 5.9138. The class weights give 49.4% (interval 0.4596 to 0.5292) and 5.73 days (5.5560 to 5.9133).
Now judge the stages against the truth, because this example can. The population values are 49.9% for the flu shot and 5.73 days for mental health. Both adjusted intervals cover both truths in this draw, and the adjusted mental-health estimate lands almost exactly on its target. The flu shot teaches the harder lesson: the unweighted 50.6% sits closer to the truth than either adjustment does, even though the adjustments are the better method. One draw proves nothing in either direction, and two adjustments agreeing with each other proves even less, since both are built from the same frame variables and the same respondents. The evidence for the adjustment is the Monte Carlo in the verification package: over 500 draws from this same population, the unweighted and base-weighted flu estimates average 1.3 points above the truth, and the class and propensity adjustments cut that average bias to 0.4 points; for mental-health days the average bias falls from about −0.09 days unweighted to −0.01 (classes) and −0.02 (propensity); the post-stratified propensity set this guide carries forward lands in the same place, with an average flu bias of +0.004, a mental-health bias of −0.024, and interval coverage of 96% and 94%; and the final 95% intervals cover the truth 94% to 96% of the time. Stage your confidence on that table, not on whether the adjustment won the draw in front of you. Note, too, that the base weights alone buy nothing in this population: the flu bias is +0.0130 unweighted and +0.0132 base-weighted, because district, the design variable, does not drive the outcomes here; the adjustments earn their keep by using variables that do.
Doing it in Analysis Studio
Open Analysis Studio and load the full sample file, all 1,500 rows with their dispositions intact. One thing to know before the steps: the weighting module has no eligibility step of its own. It reads a single response variable, in which the level you name as responded counts as a respondent, every other recorded level counts as an eligible nonrespondent, and a blank counts as not in the weighting at all. The eligibility work therefore happens first, in step 2, in the Prepare data panel, and the module's arithmetic then reproduces the class stages above exactly. Its propensity run ends with the calibration stage described in Stage 3b, so the final weights it reports are the post-stratified set printed in Tables 5 and 6: the same total of 81,661.73, smallest 26.11, largest 177.88.
- Start from the base weights. The dataset file carries a base_wt column holding each district's population divided by its sampled count, the Table 1 figures (100 in Metro down to 20 in West). Nothing runs yet: the base weights come from the file, so check the column against Table 1 before you move on.
- Do the eligibility step in the Prepare data panel. The panel sits above the modules; every change there is previewed before it applies and recorded in a history you can read as SPSS or R syntax. Three changes, all under the panel's Operations tab. First, Select or filter cases: keep cases where eligible = 1, with How set to Delete the other cases. The preview reports 1,274 rows kept and 226 removed: the 84 known ineligibles and the 142 cases of unknown eligibility leave the dataset, and the unknowns' weight reaches the known eligibles through the factors in the next change. Second, Set values by condition: create a new variable, elig_factor, with district = "Metro" set to 1 + 24/276, district = "North" to 1 + 29/271, district = "South" to 1 + 25/275, district = "East" to 1 + 33/267, and the Otherwise value, which covers West, to 1 + 31/269. Enter each factor as the arithmetic itself, not as a rounded decimal: one plus the district's unknown-eligibility cases over its known-status cases (24 unknowns among 276 known-status cases in Metro), which is the Table 2 allocation written out, so nothing is lost to rounding and the adjusted weights sum to exactly 81,661.73. Third, Compute a variable: base_adj = base_wt * elig_factor. Its preview reports 1,274 valid values running from 22.30 to 108.70. The file also carries district_age, the district and age group combined (for example, West, 18-34); step 3's classes cross the two variables, and the module takes the cross as a single column. If your own file does not carry it, Compute a variable with CONCAT(district, ", ", age_group) makes it. While you work, the dataset profile above the panel flags two variables: tenure_years, with 11 extreme values, and mh_days, with 1. Both are expected in this simulated data, a long tail of register tenures and one heavy month of poor mental health, and neither affects the weighting: tenure enters only through the propensity model in step 4, and mh_days is an outcome. If you skip this step and load the raw dispositions into the module instead, the module will treat every recorded non-responded level as an eligible nonrespondent, ineligibles included, and its totals will describe the wrong population.


The panel's History tab records the three changes. In SPSS:
```spss SELECT IF ((eligible = 1)). EXECUTE.
DO IF (district = 'Metro'). COMPUTE elig_factor = (1 + (24 / 276)). ELSE IF (district = 'North'). COMPUTE elig_factor = (1 + (29 / 271)). ELSE IF (district = 'South'). COMPUTE elig_factor = (1 + (25 / 275)). ELSE IF (district = 'East'). COMPUTE elig_factor = (1 + (33 / 267)). ELSE. COMPUTE elig_factor = (1 + (31 / 269)). END IF. EXECUTE.
COMPUTE base_adj = (base_wt * elig_factor). EXECUTE. ```
And in R, using the helper functions the panel's own prelude defines:
``r df <- df[!is.na((df$eligible == 1)) & ((df$eligible == 1)), ] df$elig_factor <- ms_do_if((df$district == "Metro"), (1 + (24 / 276)), ms_do_if((df$district == "North"), (1 + (29 / 271)), ms_do_if((df$district == "South"), (1 + (25 / 275)), ms_do_if((df$district == "East"), (1 + (33 / 267)), (1 + (31 / 269)), NA), NA), NA), NA) df$base_adj <- (df$base_wt * df$elig_factor) ``
In plain R, without the panel's prelude, the same three changes read:
``r df <- df[df$eligible %in% 1, ] f <- c(Metro = 1 + 24/276, North = 1 + 29/271, South = 1 + 25/275, East = 1 + 33/267, West = 1 + 31/269) df$elig_factor <- unname(f[df$district]) df$base_adj <- df$base_wt * df$elig_factor ``
- Build the nonresponse adjustment, classes first. Open the Survey Weighting and Raking module on the prepared dataset and choose base_adj as the base weights. Under Set up the weighting, set the nonresponse adjustment to Weighting classes, the response variable to respondent with responded level 1, and the class variable to district_age. The module also calibrates after adjusting, so under Add calibration margins give it one margin: district, with the Stage 2 district totals as targets (27,934.78 in Metro, 22,760.15 in North, 16,952.73 in South, 8,393.26 in East, 5,620.82 in West), the calibration method set to Post-stratification, and Match the first margin's total left unticked. Those targets are the totals the adjusted weights already have, so for the class run the calibration changes nothing, and the report's margin check shows zero differences; its job here is to set up step 4. Run it. The report lists each class with its eligible and respondent counts and the factor, the same figures as Table 3. Read the largest factor (1.6136, West, age 18 to 34) and the respondent count behind it (44) before you accept the adjustment. The final weights sum to 81,661.73, with the smallest 29.84 and the largest 147.19.


- Build it again by propensity. Change the nonresponse adjustment to Response propensity, with district, age group, sex, and tenure as the model variables; the module groups the eligibles into five classes at the quintiles of the predictions. Keep the district margin from step 3, and the base weights you supplied: the module fits the model weighted by them. This time the calibration does move weights: the propensity-adjusted district totals drift off the Stage 2 totals, and the calibration brings them back, which is the small per-case movement described above. The report's smallest and largest final weights read 26.11 and 177.88, against the reference set's 26.15 and 178.29, on the same total of 81,661.73. Compare the report against Table 4: the group counts and the falling gradient of factors.


- Choose the set you will analyze with, and say why in your notes. This guide carries the propensity weights forward. Take the run's dataset version (Use this dataset now) so the data carries weight_final, then declare the design in the Survey design card: Taylor, weight column weight_final, strata column district. With the district stratum and the chosen final weight attached to the dataset, every later module computes design-based standard errors.

Run Descriptives on the weighted dataset to see the carried-forward set at work. The tool prints the flu-shot share as 49.51%, with a 95% interval of 46.03% to 53.00%, and mean poor-mental-health days as 5.73, standard error 0.0925, with an interval of 5.551 to 5.914. Above the report, a Checks note states that the weight variable is missing for 289 of the 1,274 cases and that those cases are excluded from the design-based analysis: the 289 eligible nonrespondents, who carry no final weight by construction, the same exclusion the first guide in this series reports for its nonrespondents. The estimates match Table 6's post-stratified column, and the mental-health standard error matches as well. The one visible difference is the flu-shot interval's lower end, 46.03% against the 46.02% in Stage 4: the tool builds proportion intervals on the logit scale, as the first guide in this series discloses, while Stage 4 prints the linear interval. The estimate underneath is the same either way.
Reading the output
Start with the weight sum, because it tells you which population your estimates describe. A sum of 81,661.73 says your results are about the eligible population your frame actually reaches, about 6% smaller than the register's headline count (and, in this simulated case, within 165 of the true eligible population of 81,497). Report it that way; a reader who checks your total against the register will find the difference whether you explain it or not.
Next, the design effect. The final weights, the propensity set after its district calibration, have a coefficient of variation of 0.4909, so Kish's approximation gives a design effect of 1.2410 and an effective sample size of about 794 of your 985 respondents. The design-based calculation for the flu-shot estimate gives 1.2442 and about 792. Most of that cost is the deliberate oversample of the small districts, not the adjustments: equal allocation buys district-level precision with overall precision, and this is the bill. If the bill is larger than you expected, Weight trimming and the design effect in this series covers trimming and what it trades away.
The plain-language result sentences for your report: an estimated 49.5% of adults in the county had a flu shot in the past year (95% CI: 46.0% to 53.0%), based on 985 respondents weighted to the county's estimated eligible population of 81,662. And: adults averaged 5.73 days of poor mental health in the past month (95% CI: 5.55 to 5.91). Write yours the same way: the estimate, the interval, the respondent count, and the population the weights actually sum to.
Checks and pitfalls
Check the disposition counts before any weight exists. Your four states must add back to the sampled total (985 + 289 + 84 + 142 = 1,500 here, with the 289 eligible nonrespondents inside the class and propensity tables). Check the eligibility rates by cell against their sampling error before you tell a story about them: the district rates run 0.9312 to 0.9483, a spread of under two points, and a rate near 0.94 built on about 270 known cases carries a standard error of about 0.018, so that spread is what noise alone produces. It says nothing about any district's register being staler. The gradient that is real sits in the tenure bands, 0.6486 rising to 0.9820, far beyond anything noise explains. Check every class for size: the West, age 18 to 34 factor of 1.6136 rests on 44 respondents, so those 44 people speak for 71 eligible sampled cases. That is legal arithmetic and a fragile estimate at the same time; if a class that thin drives a headline number, compare against the propensity result before you publish either. Check the propensity gradient, as Stage 3b describes, and the propensity range itself: predictions down near 0.5146 are comfortable, but a model that hands some respondents propensities near zero will hand them enormous inverse weights if you skip the grouping step.
The three mistakes this stage sees most often. First, counting ineligibles as nonrespondents, which inflates the nonresponse factors and quietly redefines your population to whoever the register still lists correctly. Second, deleting the unknown-eligibility cases without allocating them, which assumes every one of them was ineligible and shrinks your weighted total below the eligible population. Third, building classes or a propensity model from variables recorded only for respondents, often the outcomes themselves in disguise: an adjustment can only use what is known about the people who did not answer, because they are the ones being adjusted for.
Verify it yourself
The verification package for this guide contains the dataset (data.csv, all 1,500 sampled cases), the generating script, a Monte Carlo script (monte_carlo.py, 500 draws reporting bias and interval coverage for each stage, and the district-versus-tenure eligibility comparison), reference scripts in R and Python (reference.R, reference.py), and expected_outputs.csv with every computed result printed above, its location in this guide, and its tolerance. Counts and base weights are exact; estimates are stated to four significant digits, and both scripts must reproduce them within that tolerance. Run either script and it prints PASS or FAIL for each figure.
Package: Download it from the verification package page.
Related guides
- The unweighted number is the wrong number: survey weighting in Analysis Studio: the full pipeline this guide's two stages open, including calibration and design-based estimation.
- Raking to population margins: setup, convergence, and diagnostics: the stage that follows this one, with convergence and diagnostics.
- Weight trimming and the design effect: when the weight spread itself becomes the problem.
The Investor Stats Cheat Sheet
A free three-page PDF: breakeven win rates, stop-loss sizing, volatility drag, reverse valuation, and how to tell a real track record from noise. Plus new tools as they ship.
Comments
No comments yet. Ask the first question.