Skip to content
SlateGitOrgPublic

About

Ranks survey interviewers for back-checks with fabrication indicators standardised within region and a robust MCD distance, scored on planted fabricators so rural interviewers are not blamed.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

curbstone

CI

curbstone

curbstone ranks survey interviewers for back-check re-interviews. It computes ten fabrication indicators per interviewer from the interview data and its paradata, standardises each indicator within region with a median/MAD robust z-score, combines them with a Minimum Covariance Determinant (MCD) Mahalanobis distance, and returns a budgeted back-check list with the three most suspicious interviews to revisit for each interviewer. Quality is measured as recall of planted fabricators at a fixed budget on synthetic data (the data is synthetic; no real survey is included).

The problem

Household surveys run on tablets employ hundreds of field interviewers, and a few fabricate interviews to meet quotas: very short interviews, answers chosen to skip whole modules, copied questionnaires. Back-check re-interviews are expensive, so a supervisor can verify perhaps one interviewer in ten. Ranking by a single indicator such as duration sends the team to every honest interviewer in rural regions, where interviews are legitimately shorter and households own fewer assets. curbstone standardises within region so that a rural interviewer is compared with rural peers, and the tests measure the failure it avoids by switching standardisation off.

How it works

flowchart LR
    A[Interviews and paradata<br/>answers, GPS, timestamps] --> B[Per-interviewer indicators<br/>10 fabrication signals]
    A --> S[Near-duplicate pairs<br/>blocked by interviewer]
    S --> B
    B --> C[Robust z-scores<br/>median and MAD within region]
    C --> D[MCD robust Mahalanobis distance<br/>with per-indicator contributions]
    B --> P[Permutation p-values<br/>interviews shuffled within region]
    D --> E[Budgeted back-check list<br/>top k interviewers, 3 interviews each]
    P --> E
Loading
  • indicators.py: median duration, share of interviews under 15 minutes, straightlining on a 10-item Likert battery, Whipple index of household ages, share of incomes ending in 000, share of skip-triggering answers, within-interviewer variance of the 12-item asset list, maximum pairwise questionnaire similarity, GPS concentration (within 50 m of another interview by the same interviewer) and off-hours share.
  • similarity.py: pairs of questionnaires with at least 90% identical answers across 40 items, skipped items excluded. It has two code paths: near_duplicate_pairs compares only interviews of the same interviewer (blocking) and feeds the pairs command, while the indicator kernel builds the similarity matrix of every pair in a region, because the permutation null reads the same-interviewer blocks of shuffled assignments. The two agree on the observed data.
  • standardize.py: robust z-scores within region.
  • score.py: scikit-learn MinCovDet with a fixed random_state; contributions are the extra squared distance each indicator adds given the others.
  • permutation.py: 500 seeded permutations of interviews among the interviewers of a region, one-sided p-values towards fabrication.
  • backcheck.py: the top k interviewers, ordered by distance descending then interviewer id, and the 3 interviews whose evidence best matches each interviewer's top indicators.

Quick start

python -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/curbstone generate --seed 4 --out data
.venv/bin/curbstone indicators --data data
.venv/bin/curbstone rank --budget 12 --data data --truth
.venv/bin/curbstone rank --budget 12 --data data --truth --no-region-standardize
.venv/bin/curbstone explain INT-047 --data data
.venv/bin/curbstone pairs --data data
.venv/bin/python scripts/demo.py

Example output

python scripts/demo.py (seed 4: 6,000 households, 120 interviewers in 6 regions of which 2 are rural, 8 planted fabricators). The last column comes from the ground-truth sidecar and is not available to the ranking.

Synthetic survey, seed 4: 6000 interviews, 120 interviewers, 8 planted fabricators

Back-check list, budget 12, indicators standardised within region
rank  interviewer region     distance  top indicators                      interviews to revisit  planted
   1  INT-004     Metro         52.82  asset_variance, income_round        HH-00148 HH-00150 HH-00152  smoother
   2  INT-018     Metro         47.59  short_share, income_round           HH-00870 HH-00871 HH-00894  speeder
   3  INT-005     Metro         46.15  short_share, straightlining         HH-00243 HH-00218 HH-00223  speeder
   4  INT-047     Valley        36.85  short_share, median_duration        HH-02325 HH-02310 HH-02339  speeder
   5  INT-025     Harbor        28.82  max_similarity, gps_concentration   HH-01220 HH-01232 HH-01231  copier
   6  INT-103     Savanna       19.92  asset_variance, income_round        HH-05110 HH-05114 HH-05118  smoother
   7  INT-076     Lakeside      19.39  gps_concentration, max_similarity   HH-03744 HH-03769 HH-03759  copier
   8  INT-109     Savanna       18.00  gps_concentration, max_similarity   HH-05386 HH-05394 HH-05418  copier
   9  INT-050     Valley        13.74  gps_concentration, straightlining   HH-02454 HH-02457 HH-02458  -
  10  INT-053     Valley        13.43  gps_concentration, median_duration  HH-02602 HH-02622 HH-02601  -
  11  INT-049     Valley         8.16  gps_concentration, income_round     HH-02406 HH-02412 HH-02417  -
  12  INT-083     Upland         6.83  straightlining, gps_concentration   HH-04102 HH-04114 HH-04125  -

Recall of planted fabricators at budget 12
seed 4, within region: 8/8 planted fabricators in the top 12 (recall 1.000), honest rural interviewers in the list: 1
seed 4, pooled       : 8/8 planted fabricators in the top 12 (recall 1.000), honest rural interviewers in the list: 4
seeds 1-5, within region: mean recall 1.000, mean honest rural interviewers in the list 0.8
seeds 1-5, pooled       : mean recall 1.000, mean honest rural interviewers in the list 4.0

curbstone explain INT-047 --data data for a planted speeder:

INT-047 in Valley: rank 4 of 120, robust distance 36.85
indicator               value  robust z       side  contribution  p-value
short_share             1.000     26.86 suspicious        753.39   0.0001
median_duration         8.750    -18.80 suspicious        130.11   0.0001
asset_variance          0.226     -0.15 suspicious         15.32   0.4874
skip_share              0.788      6.70 suspicious          7.78   0.0001
off_hours               0.135      0.36 suspicious          4.14   0.4064
whipple               117.347      0.69 suspicious          3.94   0.2901
straightlining          0.000     -1.29     benign          0.00   1.0000
income_round            0.077      0.00     benign          0.00   0.5453
max_similarity          0.657      0.00     benign          0.00   0.7487
gps_concentration       0.038     -0.57     benign          0.00   0.0689
p-values: 500 permutations within Valley, one-sided towards fabrication
interviews to revisit: HH-02325 HH-02310 HH-02339

curbstone pairs --data data ends with 62 pairs with at least 90% identical answers.

Design decisions

  • Standardise within region, then score. Rural interviews are legitimately about 25% shorter and rural households own fewer assets, so a pooled score sends the back-check team to honest rural interviewers. In the demo, pooling puts 4 honest rural interviewers in the top 12 against 1 within region. The cost is that a region needs enough interviewers (20 here) for a stable median and MAD.
  • MCD instead of the classical covariance. The classical Mahalanobis distance lets the fabricators inflate the covariance estimate and hide themselves. MinCovDet fits on the most central subset, so correlated indicators are combined without that masking. The cost is a randomised fit, which is why random_state is fixed and distances are rounded to 6 decimals before ties are broken by interviewer id.
  • Contributions as conditional distance, suspicious side only. Each indicator's contribution is the squared distance with it minus the squared distance without it, so two correlated indicators do not both claim the same evidence, and contributions are never negative. A squared distance has no sign, so an indicator far on the honest side would still score high; the explain table therefore shows the robust z and a side column, and only indicators on the suspicious side (below the regional median for median_duration and asset_variance, above it for the rest) count as evidence. Benign-side indicators show contribution 0.00, are never named in the back-check list, and get no weight when choosing interviews to revisit. They explain a rank; they do not replace the permutation p-values, which use the interviewers' own raw indicators.
  • Permutation p-values within region. Shuffling interviews among interviewers of one region keeps regional differences in the null, so a rural speeder is tested against rural interview durations. With 500 permutations the smallest reportable p-value is about 0.0001 because null values of all interviewers are pooled.
  • Recall at a budget as the quality measure. The score is judged on how many planted fabricators land in a list of 12, across seeds 1 to 5, rather than on an abstract anomaly score. Recall here is on synthetic data with planted styles, so it shows the method recovers these patterns, not that it will on every real survey.
  • Neutral Whipple for no usable ages. whipple_index returns nan when no age falls in 23-62, but the per-interviewer whipple indicator scores such an interviewer as 100.0 (no heaping) so the indicator matrix stays finite.
  • Tested dependency ranges. Tests run with warnings as errors, so dependencies are capped at the versions the suite was run on (numpy 2.5, pandas 3.1, scipy 1.18, scikit-learn 1.9) and ruff is pinned in CI.
  • Robust z fallback. When more than half of an indicator's values are identical the MAD is zero; the scale then falls back to the mean absolute deviation, and to 1 for a constant column, so the regional median is still exactly 0.

Testing

73 tests, run with:

GITHUB_ACTIONS=true CI=true COLUMNS=80 .venv/bin/python -m pytest -q

They cover hand-computed indicator fixtures (Whipple 100.0 and 500.0, straightlining, income rounding), recall 1.0 for planted copy pairs with no honest pair at 90%, regional medians of 0 after standardisation, recall of exactly 8 of 8 at budget 12 for seed 4 and mean recall 1.0 across seeds 1 to 5, the exact counts quoted in Example output (1 honest rural interviewer within region against 4 pooled, 62 near-duplicate pairs, mean 0.8 across seeds), seeded permutation p-values, the top-2 suspicious-side contributions for every planted fabricator, named indicators always on the suspicious side, ranking order and determinism, and the CLI.

Project layout

src/curbstone/   indicators, similarity, standardize, score, permutation, backcheck,
                 generator, evaluation, pipeline, report, io, schema, cli
scripts/demo.py  back-check list and recall with and without region standardisation
tests/           pytest suite

License

MIT

About

Ranks survey interviewers for back-checks with fabrication indicators standardised within region and a robust MCD distance, scored on planted fabricators so rural interviewers are not blamed.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages