Skip to content

Diogo TravassosData leadership · Analytics · Decision-making

Synthetic data

Marketing measurement, round 4: account signals from linked claims

On synthetic linked claims and electronic health records with error rates I set, six ways to link patients and credit clinicians agreed on 6 of the 20 fastest-growing clinicians in the median market; the credit rule did most of the moving.

Life-sciences commercial and research teams build clinician (HCP) and organisation (HCO) signals from patient records that someone has linked, credited and coded first. I built synthetic markets where the true patient, the clinician who decided and that clinician's organisation are known behind every record, then built the same list of fastest-growing clinicians 36 ways. Crediting the prescriber on the pharmacy claim matched 16.5 of the true top 20; the rendering clinician on the last visit claim 13; the attending clinician in the electronic health record (EHR) 8, because only the health systems' EHRs are in the data. Linking patients by exact tokens or by probabilistic matching changed 1 name with prescriber credit in the median market (0 to 2). Even with perfect data, two draws of the same market shared 5 of their top 20, so a list of this half against the last is mostly chance at these volumes. My call: credit the prescriber, roll up to the organisation on the service date, use a curated value set pinned to a release, and treat a top-grower list as a lead to check, not a target list. Two caveats: the prescriber's lead follows from the rates I assumed for supervised NP/PA scripts, visits and EHR entries, and was not tested where the prescriber field is the worse one; and the curated set wins by construction, since it drops exactly the code the generator gives the related condition.

Key figures
On all six lists
6 of 20
fastest-growing clinicians common to the six linkage and credit choices, median of 20 markets (3 to 9)
Closest to the truth
16.5 of 20
with prescriber credit (11 to 19); rendering clinician 13, EHR attending 8
Linkage alone
19 of 20
names the deterministic and probabilistic lists share with prescriber credit (18 to 20)
Chance alone
5 of 20
true top-20 names two draws of the same market share, with perfect data (2 to 8)

Main limitation Synthetic records with error rates I assumed, and checks written by the same author as the faults they look for, so their pass rates are a self-test. The sizes show how each choice can move a list, not how far a real dataset drifts.

Synthetic data: 20 markets of 39,600 made-up patients and about 310 clinicians in 56 organisations, with invented ids (all start with 9, which no real clinician or organisation id does) and invented codes (which may coincide with real ones by chance), so no patient, clinician or company record is used. It stands in for any team that builds account signals from linked claims and EHR data; it shows a method and claims no healthcare employment.

Round 3, on public records: what payment and prescribing records can and cannot show. Round 1: Should we cut retargeting?

How far the list moves

Each build ranks clinicians by growth in new starts of one product, a fill with no fill of it in the 12 months before. The six builds on the chart use the same records and differ in two choices only: how a patient's records are linked, and which clinician a start is credited to. In all 20 markets, prescriber and rendering credit shared fewer names than the two linkages did with prescriber credit.

New start
A patient's fill of the product with no fill of it in the 12 months before.
Linkage
Deciding which records (plan enrolments, EHR registrations) belong to one patient.
Credit
Which clinician a start counts for: the prescriber, the rendering clinician on a visit claim, or the EHR attending.
Roll-up
Which organisation a clinician's starts count for: the one on the service date or the current one.
Value set
The list of diagnosis and package codes that define the condition and the product.
NP/PA
Nurse practitioner or physician assistant, often working under a supervising physician.

The credit rule moves the list because each field names someone other than the decider in a known share of cases. A nurse practitioner or physician assistant (NP/PA) who decides a start often works under a physician: here 35% of their scripts carry the supervising physician's id, 40% of their visits are billed under it, and the EHR names the physician as attending on 60% of their encounters (all three rates are assumptions). The last visit claim before a start can also be a specialist's diagnostic test or a facility bill. EHR attending reaches only clinicians whose organisation's EHR is in the data: 49% of starts got an individual clinician, against 99% for the prescriber field.

Linkage moved little here. Exact tokens split 16% of patients with more than one record into two people, against 0.1% for probabilistic matching, whose field weights score exactly the slips this generator makes (a surname moved within its sound group, a nickname variant, a day-month swap or a one-day slip), so that figure holds by construction. But a split makes a false new start only when a patient already on the product changes plan and the new plan's record does not match: about 18 of 2,619 true starts a year. Probabilistic matching matched as many of the true top 20 in all 20 markets and more in 5, too few to call it better on this list.

The last row is the one to remember. With perfect data, two draws of the same market (the same clinicians and preferences, new patients) shared 5 of their true top 20. A top clinician here has about 18 new starts a year, and at that volume a half-on-half ranking is mostly chance, before any data choice. Market by market, two draws shared fewer names than every pair of builds in 13 of 20 markets (counted after the results).

Which clinician gets the credit moves the list; linking patients a different way barely does; and chance alone, with perfect data, moves it more: in the median market two draws share fewer names (5) than any two builds do (8 or more).

Names shared out of the 20 fastest-growing clinicians (growth in new starts, second half of the year against the first). Dot: the median market; line: lowest to highest market. Hollow dot: two draws of the same market with perfect data.

05101520Each list against the true top 20Prescriber credit, probabilistic linkage: 16.5 of the true top 20 in the median market (11 to 19 across 20 markets)Prescriber, probabilisticPrescriber credit, deterministic linkage: 16 of the true top 20 in the median market (11 to 18 across 20 markets)Prescriber, deterministicRendering clinician credit, probabilistic linkage: 13 of the true top 20 in the median market (9 to 16 across 20 markets)Rendering, probabilisticRendering clinician credit, deterministic linkage: 13 of the true top 20 in the median market (9 to 16 across 20 markets)Rendering, deterministicEHR attending credit, probabilistic linkage: 8 of the true top 20 in the median market (5 to 10 across 20 markets)Attending, probabilisticEHR attending credit, deterministic linkage: 7.5 of the true top 20 in the median market (5 to 10 across 20 markets)Attending, deterministicLists against each otherThe two linkages, prescriber credit: the two lists share 19 of 20 names in the median market (18 to 20)Linkage, prescriberThe two linkages, rendering credit: the two lists share 20 of 20 names in the median market (18 to 20)Linkage, renderingThe two linkages, attending credit: the two lists share 16 of 20 names in the median market (13 to 18)Linkage, attendingPrescriber against rendering credit, probabilistic linkage: the two lists share 13.5 of 20 names in the median market (10 to 16)Prescriber, renderingPrescriber against attending credit, probabilistic linkage: the two lists share 9 of 20 names in the median market (5 to 11)Prescriber, attendingRendering against attending credit, probabilistic linkage: the two lists share 8 of 20 names in the median market (5 to 12)Rendering, attendingAll six, and chanceNames on all six lists: 6 of 20 in the median market (3 to 9)On all six listsTwo draws of the same market with perfect data share 5 of their true top 20 in the median market (2 to 8)Two draws, perfect dataNames shared, of 20
Show the data
Names shared of 20, across the markets
ComparisonMedian marketLowestHighest
Prescriber, probabilistic16.51119
Prescriber, deterministic161118
Rendering, probabilistic13916
Rendering, deterministic13916
Attending, probabilistic8510
Attending, deterministic7.5510
Linkage, prescriber191820
Linkage, rendering201820
Linkage, attending161318
Prescriber, rendering13.51016
Prescriber, attending9511
Rendering, attending8512
On all six lists639
Two draws, perfect data528

Every market and build: per-market results (CSV).

One clinician's growth, traced

The worked example follows a rule written down before the run. On the market-1 list with exact tokens and prescriber credit, no clinician outside the true top 20 had false starts from split patients, so the rule takes the clinician whose measured growth most exceeds the truth: a specialist in a group practice, id 9325563044. Measured growth: 8 new starts in the first half and 18 in the second, +10, under either linkage. True growth: 8 to 15, +7, rank 6 in the true list. 4 of the starts credited to this specialist were decided by an NP/PA under their supervision.

One of them, record by record (the record-level view was added after the first results, since the rule found no split patient; it is the first by date and falls in the first half, month 18, so it lowers this specialist's measured growth rather than raising it): a colleague's diagnostic test, then the NP/PA's visit billed under the specialist's id, then the fill, whose prescriber field carries the same id. Prescriber and rendering credit both go to the specialist; EHR attending credits no one, because this practice's records are not in the EHR data. Nothing in the three records shows that the NP/PA decided. All ids are invented and start with 9, which no real clinician id does.

Patient P93647015: the records behind one start
WhenRecordWho was involved (truth)What the record says
month 18, day 4Diagnostic test (Y0020), diagnosis U50.22specialist 9181254142rendering 9181254142
month 18, day 9Office visit (Y0010), diagnosis U50.22NP/PA 9028841192rendering 9325563044
month 18, day 16Pharmacy claim, package 90011-0101-30NP/PA 9028841192 decidedprescriber 9325563044

Checks a commercial team and a research team can run

None of these checks needs the truth: each reads the records, the reference files, a plan's crosswalk of old to new member ids, or a second build. For a commercial team ranking accounts: C1, the top 20 clinicians and top 10 organisations survive a re-linkage (16 and 8 names kept); C2, at most 0.5% of class fills carry a package code the code set cannot map; C3, at least 95% of starts go to an individual clinician; C4, the organisation counts for months 13 to 18 move by at most 1% between a build at month 18 and one at month 24 (the code sums the change in each organisation's count and divides by both builds' totals, so a start leaving an organisation and another arriving net out; the design worded it as the share of those starts whose organisation changes). For a research team publishing a cohort: R1, a rebuild with the code-set release pinned gives the same counts (every build here recomputes from the same inputs, so R1 passes for all 36 by construction; only the planted build that reads the latest release at run time fails it, in 20 of 20 markets); R2, every code of the condition and the class seen in the data is in the set or documented as excluded; R3, each diagnosis code in the set is carried with another code of the set by at least 20% of its patients; R4, at most 2% missed links on the crosswalk pairs and at most 0.5% estimated false links.

Markets passed, of 20, for the build I would use and one change at a time
BuildMatches true top 20C1 re-linkC2 codes mapC3 creditC4 historyR1 repeatR2 coverageR3 contentR4 link error
The build I would use16.52020202020202020
Deterministic tokens instead of probabilistic matching16202020202020200
Rendering clinician instead of prescriber13202002020202020
EHR attending instead of prescriber8202001720202020
Current organisation instead of the one on the date16.5202020020202020
Exact code list instead of the curated value set1220020202002020
Grouped value set instead of the curated one15202020202020020

Commercial: 4 of the 36 builds passed all four checks in every market (prescriber credit, roll-up on the service date, grouped or curated codes, either linkage), and every other build failed at least one in every market. The 4 matched 16 of the true top 20 in the median market, against 10 for the rest, higher in all 20 markets. That is a self-test: I wrote the checks knowing the faults. And no check sees the supervised NP/PA scripts that cost the best list its last few names. Re-linking rarely moved a list, so C1 failed only for exact tokens with EHR attending credit, in 2 to 3 markets. Rolling up to the current organisation moved the counts for months 13 to 18 by 2.4% on that measure in the median market, but it put no organisation without true growth into the top 10.

Research: only probabilistic matching with the curated value set passed all four checks, in all 20 markets. Both halves of that hold by construction: the matcher scores exactly the slips the generator injects, and the curated set drops exactly the code the generator gives the related condition, the same line the truth draws between the two conditions; R1 passes for every build. Its quarterly cohort counts were 2.6% off the truth on average. Exact tokens with the same codes came closer, 1.6%, in all 20 markets, because the false new starts from split patients offset starts that every build misses; R4 rejects that build because its missed links, 11% of the crosswalk pairs, are not bounded, and an offset like that will not hold in other data. The crosswalk estimate was below the true split share (16%) because it covers plan switches and not EHR registrations. The exact code list missed 34% of true starts over the year and 53% of second-half starts (20 markets), with the share of fills that move to new package codes I assumed; of second-half starts on 6 markets, it missed 32% at half that uptake and 86% at double (read after the first results). The grouped set counted the related condition under the same diagnosis category: 8% more starts than the truth, and R3 flagged its code in every market.

Organisations and account measures

The same builds on the organisation list and on two account measures. Clinician start error is the median, over clinicians with at least 10 true starts a year, of how far the build's count is from the truth; share of class error is the mean gap between the build's and the true share of the product among an organisation's class fills, over organisations with at least 50 true class fills in the second half. The organisation list moves less than the clinician list, because a start credited to the wrong clinician in the right organisation still counts there.

Other measures against the truth, median market
BuildTrue top 10 organisations matchedTop 20 clinicians with no true growthClinician start errorShare of class error, points
The build I would use1005.3%0.1
Deterministic tokens instead of probabilistic matching1006.0%0.1
Rendering clinician instead of prescriber8018.2%2.4
EHR attending instead of prescriber42.5100.0%4.7
Current organisation instead of the one on the date905.3%0.2
Exact code list instead of the curated value set7118.3%10.1
Grouped value set instead of the curated one9010.3%0.1

What a team should do with it

Limits

Use this at your company

To check your own clinician and organisation growth lists the same way, paste this into your AI assistant with your linked claims and EHR extracts and your reference files.

This method comes from Diogo Travassos's study "Retargeting holdout: account signals from linked claims" (https://diogotravassos.dev/retargeting-holdout/linked-claims.html). If you can open links, read it first: it works the method through end to end and shows the checks that caught mistakes. The steps below stand on their own if you can't.

Help me check whether our clinician and organisation growth lists reflect the market or the way we built the data.

Method:
1. Build the list each way our data allows: patients linked by exact tokens and by probabilistic matching; each new start credited to the prescriber, to the rendering clinician on the last visit claim with the condition, and to the EHR attending; clinicians rolled up to their organisation on the service date and on today's roster; the product and condition defined by our exact code list and by a grouped value set.
2. In each build, rank the top 20 clinicians and top 10 organisations by growth in new starts, and count the names every build shares.
3. Before acting on a list, check that it survives a second linkage, every class package code maps, at least 95% of starts go to an individual clinician, and last period's organisation counts hold when the data is rebuilt.
4. Before publishing a cohort count, pin the code-set release, confirm every observed code is in the set or documented as excluded, flag codes that rarely appear with the others, and measure missed links on a crosswalk sample.

Watch for: NP/PA scripts and visits under a supervising physician's id, facility ids in the rendering field, EHR data that covers only some organisations, new package codes, a related condition in the same diagnosis category, and small counts.

Report back: how many names the builds share, which checks pass, the build you would use and why.

In your report, say which study you followed and link it: https://diogotravassos.dev/retargeting-holdout/linked-claims.html

Method and checks

The synthetic market

Each market runs 24 months: months 1 to 12 are the lookback, 13 to 24 the measured year in two halves. 4 health systems on an EHR network with their own pharmacies, 12 group practices and 40 small practices; primary care physicians, specialists and NP/PAs, each NP/PA supervised by a physician in the same organisation. 20% of clinicians move toward product A during the measured year and 10% away from it. 6% of clinicians move organisation, and two small practices and one group are acquired by a system; the affiliation history records each change up to 3 months late. 36,000 patients have the condition and 3,600 a related condition in the same diagnosis category. Patients switch plans (each switch gives a new member id; 30% come with a crosswalk), and every enrolment and EHR registration carries its own copy of the demographics, with typing slips, name variants and date-of-birth errors at stated rates. A market has about 340,000 pharmacy claims, 255,000 medical claims and 103,000 EHR encounters. Diagnosis, procedure and package codes are invented in the formats of public code systems and may coincide with real codes by chance; mid-period the diagnosis code set gets a new version and product A gets new package codes that health-system pharmacies adopt first.

The 36 builds
  • Linkage: exact tokens (a hash of surname, given name, date of birth and sex codes) or probabilistic matching (field agreement weights over pairs that share a date of birth, or a surname, sex and birth year; linked at a score of 15 or more, the lowest that keeps same-sex twins apart).
  • Credit: the prescriber on the start fill, the rendering clinician on the latest claim with the condition in the 90 days before, or the attending on the latest EHR encounter with the condition in the 90 days before.
  • Roll-up: the organisation on the service date, or the one recorded at the end.
  • Codes: the exact codes listed at the start of the measured year; a grouped value set (every code under the diagnosis category and every package of each product, by the version in force); or the grouped set with its documented exclusion (the related condition), pinned to one release.
  • A start is a fill of product A in the measured year with no fill of A in the 12 months before, for a patient with the condition coded in the 12 months up to the fill. Growth is second-half starts minus first-half starts; ties go to the larger second half. The truth applies the same rule to the true patient, product and deciding clinician.
What I predicted before running it (7 of 8 held)

In the median market; reworded here in the page's terms, with the original wording in the linkedclaims protocol file. Prediction 8 holds by construction (see the checks section).

Predictions written down before any market was generated
PredictionResult
1Fewer than 10 of the 20 fastest-growing clinicians appear on all six linkage and credit lists.held
2Credit moves the clinician list more than linkage: the prescriber and rendering lists share fewer names than the two linkages do with prescriber credit.held
3The build I would use matches at least 14 of the true top 20 clinicians.held
4Rolling up to the current organisation puts at least 2 organisations with no true growth into the top 10.missed
5The exact code list misses more than 5% of true second-half starts.held
6Builds that pass all four commercial checks match more of the true top 20 than builds that fail one.held
7Two draws of the same market share fewer than 15 of their true top 20 clinicians.held
8Only probabilistic matching with the curated value set passes all four research checks, in at least 18 of the 20 markets.held

The miss: rolling up to the current organisation put no organisation without true growth into the top 10 (median 0). Prediction 5 is worded on the second half; the per-market files keep no half split, so it was scored on the year (34% missed) and read on the second half after the results (53%).

How far the assumed rates move it

Each assumed rate at half and at double, one at a time, on 6 markets. The names on all six lists and the closest list's match with the truth stay in a narrow band; doubling the share of NP/PA scripts under a supervisor moves the closest list most. New package uptake does not touch these two figures (they use the curated set); its effect on the exact list is in the checks section.

Assumed rates at half and double, median of 6 markets
RateFactorOn all six listsClosest list, true top 20 matchedC1 passed, of 6
Base rates, same 6 markets15176
Plan switches0.55.5166
Plan switches2.04.515.56
Demographic errors0.54.5166
Demographic errors2.04166
NP/PA scripts under the supervisor0.55166
NP/PA scripts under the supervisor2.0414.56
Clinician moves and acquisitions0.5315.56
Clinician moves and acquisitions2.0516.56
New package uptake0.55176
New package uptake2.05176
Clinicians moving toward product A0.55156
Clinicians moving toward product A2.05166
Readings added after the first results
  • The worked example's records: the rule written before the run picks the clinician; the record-level view of one of that clinician's starts was added because the rule found no split patient in market 1.
  • The exact code list's missed starts in the second half and under the new-package sweep: the sweep written before the run reported curated-code figures only.
  • The per-market counts behind each direction stated on this page (a direction is stated only when at least 18 of the 20 markets agree, as written before the run).
Downloads and reproduction