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.
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).
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.
Show the data
| Comparison | Median market | Lowest | Highest |
|---|---|---|---|
| Prescriber, probabilistic | 16.5 | 11 | 19 |
| Prescriber, deterministic | 16 | 11 | 18 |
| Rendering, probabilistic | 13 | 9 | 16 |
| Rendering, deterministic | 13 | 9 | 16 |
| Attending, probabilistic | 8 | 5 | 10 |
| Attending, deterministic | 7.5 | 5 | 10 |
| Linkage, prescriber | 19 | 18 | 20 |
| Linkage, rendering | 20 | 18 | 20 |
| Linkage, attending | 16 | 13 | 18 |
| Prescriber, rendering | 13.5 | 10 | 16 |
| Prescriber, attending | 9 | 5 | 11 |
| Rendering, attending | 8 | 5 | 12 |
| On all six lists | 6 | 3 | 9 |
| Two draws, perfect data | 5 | 2 | 8 |
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.
| When | Record | Who was involved (truth) | What the record says |
|---|---|---|---|
| month 18, day 4 | Diagnostic test (Y0020), diagnosis U50.22 | specialist 9181254142 | rendering 9181254142 |
| month 18, day 9 | Office visit (Y0010), diagnosis U50.22 | NP/PA 9028841192 | rendering 9325563044 |
| month 18, day 16 | Pharmacy claim, package 90011-0101-30 | NP/PA 9028841192 decided | prescriber 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.
| Build | Matches true top 20 | C1 re-link | C2 codes map | C3 credit | C4 history | R1 repeat | R2 coverage | R3 content | R4 link error |
|---|---|---|---|---|---|---|---|---|---|
| The build I would use | 16.5 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 |
| Deterministic tokens instead of probabilistic matching | 16 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 0 |
| Rendering clinician instead of prescriber | 13 | 20 | 20 | 0 | 20 | 20 | 20 | 20 | 20 |
| EHR attending instead of prescriber | 8 | 20 | 20 | 0 | 17 | 20 | 20 | 20 | 20 |
| Current organisation instead of the one on the date | 16.5 | 20 | 20 | 20 | 0 | 20 | 20 | 20 | 20 |
| Exact code list instead of the curated value set | 12 | 20 | 0 | 20 | 20 | 20 | 0 | 20 | 20 |
| Grouped value set instead of the curated one | 15 | 20 | 20 | 20 | 20 | 20 | 20 | 0 | 20 |
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.
| Build | True top 10 organisations matched | Top 20 clinicians with no true growth | Clinician start error | Share of class error, points |
|---|---|---|---|---|
| The build I would use | 10 | 0 | 5.3% | 0.1 |
| Deterministic tokens instead of probabilistic matching | 10 | 0 | 6.0% | 0.1 |
| Rendering clinician instead of prescriber | 8 | 0 | 18.2% | 2.4 |
| EHR attending instead of prescriber | 4 | 2.5 | 100.0% | 4.7 |
| Current organisation instead of the one on the date | 9 | 0 | 5.3% | 0.2 |
| Exact code list instead of the curated value set | 7 | 1 | 18.3% | 10.1 |
| Grouped value set instead of the curated one | 9 | 0 | 10.3% | 0.1 |
What a team should do with it
- Credit starts to the prescriber on the pharmacy claim. It was closest to the truth here (ahead of rendering credit in 18 of 20 markets), but that ordering follows the rates I assumed: 35% of supervised NP/PA scripts, 40% of their visits and 60% of their EHR entries carry the supervisor's id. It was not tested where the prescriber field is the worse one. Measure how often your prescriber field holds a supervising physician instead of the NP/PA who decided, because no check below can see it.
- Rebuild before you rank. Run the list from a second linkage and a later rebuild, and act only on names that survive both (checks C1 and C4).
- Roll up to the organisation on the service date, and report growth that comes from clinicians joining or leaving separately, so an acquisition does not read as prescribing growth.
- Use a curated value set pinned to a release. Here it wins by construction, since it drops exactly the generator's one extra code. What carries over: every observed code of the condition and the class is in it or documented as excluded, and every count says which release it used (R1 and R2).
- Treat a half-on-half top-20 as a lead. At about 18 new starts a year for a top clinician, chance alone moves most of the list.
Limits
- 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.
- One product class, markets of one size (about 310 clinicians and 39,600 patients), and an EHR that covers the four health systems only. A bigger market, a different specialty mix or full EHR coverage would change the sizes.
- The truth credits the clinician who decided and that clinician's organisation on the date. A team that wants today's roster would count differently, and current roll-up would then be its right answer.
- There is no claims lag, no gap in coverage between plans and no pharmacy outside the data; each would add its own error.
- Patients have codes, not names, and twins are the only near-duplicates. The probabilistic matcher scores exactly the slips the generator makes, so its near-perfect linkage holds by construction; real names, families and other slips give it harder cases.
- The worked example's records, the exact list's second-half and sweep readings, and the per-market counts behind each direction were added after the first results.
- No clinical validity is claimed, and no real code value, clinician id, organisation or data source is used.
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).
| Prediction | Result | |
|---|---|---|
| 1 | Fewer than 10 of the 20 fastest-growing clinicians appear on all six linkage and credit lists. | held |
| 2 | Credit moves the clinician list more than linkage: the prescriber and rendering lists share fewer names than the two linkages do with prescriber credit. | held |
| 3 | The build I would use matches at least 14 of the true top 20 clinicians. | held |
| 4 | Rolling up to the current organisation puts at least 2 organisations with no true growth into the top 10. | missed |
| 5 | The exact code list misses more than 5% of true second-half starts. | held |
| 6 | Builds that pass all four commercial checks match more of the true top 20 than builds that fail one. | held |
| 7 | Two draws of the same market share fewer than 15 of their true top 20 clinicians. | held |
| 8 | Only 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.
| Rate | Factor | On all six lists | Closest list, true top 20 matched | C1 passed, of 6 |
|---|---|---|---|---|
| Base rates, same 6 markets | 1 | 5 | 17 | 6 |
| Plan switches | 0.5 | 5.5 | 16 | 6 |
| Plan switches | 2.0 | 4.5 | 15.5 | 6 |
| Demographic errors | 0.5 | 4.5 | 16 | 6 |
| Demographic errors | 2.0 | 4 | 16 | 6 |
| NP/PA scripts under the supervisor | 0.5 | 5 | 16 | 6 |
| NP/PA scripts under the supervisor | 2.0 | 4 | 14.5 | 6 |
| Clinician moves and acquisitions | 0.5 | 3 | 15.5 | 6 |
| Clinician moves and acquisitions | 2.0 | 5 | 16.5 | 6 |
| New package uptake | 0.5 | 5 | 17 | 6 |
| New package uptake | 2.0 | 5 | 17 | 6 |
| Clinicians moving toward product A | 0.5 | 5 | 15 | 6 |
| Clinicians moving toward product A | 2.0 | 5 | 16 | 6 |
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
- All results (JSON), every build (CSV), every market and build (CSV), the rate sweep (CSV), the readings added after the first results (JSON). The design, with the predictions, is in DESIGN-linked-claims.md; every rate is in the linkedclaims protocol file, and the invented codes in its terminology file.
- Code: the linkedclaims folder, Python standard library only, with every random draw from a fixed random stream, so a market replays byte for byte. One file per market sits in linked-claims-runs; the gather step rebuilds every result from them, and the tests check that the gather and a fresh run of the generator both reproduce the published files. The README gives the commands.