Active-comparator, new-user cohort study analyzed with difference-in-differences using medical claims and enrollment data: Does Ozempic lower the cost of obesity care?
October 15, 2026
Author: Daniel Jordan Viray
Does Ozempic lower the cost of obesity care? A study design using claims and enrollment data, explained end to end
For members with obesity, does starting Ozempic reduce their total cost of obesity-related care more than starting a different weight-loss drug?
Our data: claims plus enrollment
This study uses two linked data sources, not claims alone. Every time a member gets care, a claim is submitted so the provider gets paid — claims say what care happened and what it cost. Enrollment records are separate and simpler: they say who was covered, and for exactly which dates. We need both. Claims tell us the care; enrollment tells us whether we can trust a quiet month — and whether a member was observable for the whole study window at all:
- Who has obesity: an obesity diagnosis code [ICD-10 diagnosis code] appears on their claims. (This finds members whose obesity was coded during care — it can’t find members who never had it written on a claim.)
- Who started which drug, and when: the first pharmacy claim for Ozempic or for another weight-loss drug. That date is each member’s starting line [index date].
- What care cost: the paid amounts on all their obesity-related claims, month by month.
- Enrollment must cover the whole window: we look up enrollment for every member and require them to be enrolled for the entire relevant time — all 6 months before and all 6 months after their first fill [continuous enrollment]. Only then does a quiet month mean $0, not “missing”: the member was covered, so a month with no obesity claims is a month that genuinely cost nothing.
What we’ll do instead: rebuild the ideal trial from claims and enrollment
In real life, nobody was assigned a drug at random — so instead of comparing Ozempic users to everyone else (which would mix up the drug with the kind of person who gets it), we compare them to the fairest group claims and enrollment can give us: people who also started a weight-loss drug, just a different one. Both groups were in the same situation at the same kind of moment. Then we compare how each group’s costs changed.
What this design is called: a target trial emulation [target trial emulation] — we write down the head-to-head trial we wish we could run, then rebuild each piece of it from claims and enrollment records. The comparison group is an active comparator made of new users [active-comparator, new-user design], and the arithmetic that produces the answer is difference-in-differences [difference-in-differences · DiD]. Those are the names to use when searching the literature or talking with other researchers.
- 1Find the members — and verify enrollment
Pull members who have an obesity diagnosis code on their claims and who started a weight-loss drug. Then look up each member’s enrollment and keep only those enrolled for the entire window — 6 months before through 6 months after their first fill [continuous enrollment]. Without that check we could not tell a true $0 month from a month when the member simply was not covered.
- 2Split into two groups by what they started
Group A: first fill was Ozempic. Group B: first fill was another weight-loss drug. Everyone in the study started something — nobody is compared against “doing nothing” [active comparator].
- 3Line everyone up at their own starting line
Members start in different calendar months, so we line them up by time relative to their first fill — month 0 — not by calendar date [time zero · relative-time alignment].
- 4Add up obesity-related costs, 6 months before and 6 months after
For each member, total the paid amounts on their obesity-related claims in each month. Because enrollment has already been confirmed for the whole window, a month with no claims counts as $0 — genuinely no cost, not missing data.
- 5Compare the changes, not the end points
Each group is first compared to its own past. Then we compare the two changes. Whatever pushed both groups’ costs around equally — price inflation, the drugs helping in general — cancels out, leaving the extra effect of Ozempic [difference-in-differences].
Six members, worked end to end
Here is the whole study in miniature, with made-up numbers small enough to check on paper. Three members started Ozempic, three started another weight-loss drug; all six have an obesity diagnosis code, and in this toy example all six were enrolled for the full 12 months, so every month is observed for every member. The numbers are built in two steps — and each step is exactly what you would do with a real claims and enrollment extract:
Step 1 — get every member’s cost in every month; add each month up within a group to get the group’s total; then divide by the number of members to get the average cost per member. That last column is what the chart plots. Two highlighted rows summarize each period: the Before average, right after month −1, and the After average, right after month +6.
Step 2 — average the members within each group. That produces four group numbers — a before and an after for each group — and comparing the two groups’ changes gives the study’s answer, worked in full right below the table.
Step 1 · Every member, every month
From the claims — after checking enrollment — take each member and add up the paid amounts on all their obesity-related claims within each month, with months lined up relative to their first fill — one cost figure per member per month [member-month panel]. A month when an enrolled member filed no obesity claims counts as $0: it adds zero to the total, and the member still counts in the divisor. All figures are dollars of obesity-related cost for that month.
Ozempic group — monthly cost by member
| Month | Maria | James | Priya | Group total (all 3 members) | Average per member |
|---|
Other-drug group — monthly cost by member
| Month | Tom | Alicia | David | Group total (all 3 members) | Average per member |
|---|
Read each table top to bottom: one row per month. The group total column is every member’s cost for that month added together. The shaded average per member column [per member per month · PMPM] is that total divided by the number of members — and it is exactly what the chart below plots, month by month, one point per row. Check the first row by hand: in month −6 the Ozempic members cost $940 + $840 + $740 = $2,520 in total, and $2,520 ÷ 3 members = $840 per member — the first point on the teal line.
Step 2 · Average each group — then compare the changes
Average the three members in each group, and the twelve monthly figures collapse into four numbers: a before average and an after average for each group. These are the same figures as the highlighted Before average and After average rows in the Step 1 tables. The third row is the study’s answer — the difference between the two groups’ changes [difference-in-differences]:
| Group | Before (avg per month) | After (avg per month) | Change |
|---|
The arithmetic, step by step
No model, no black box — the headline number in that last row comes from comparing each group to its own past, then comparing those two changes. The only inputs are the four group averages in the Step 2 table: Ozempic $900 before and $630 after; other drug $700 before and $550 after. You land on the same four numbers from the Step 1 tables, too — average the six monthly “average per member” points inside the before window and you get the same $900. Walk through it:
The dashed “expected” line on the chart below is this same subtraction drawn as a picture [counterfactual]: it traces where the Ozempic group’s costs would have landed if they had fallen only as much as the other drug’s did. Two pairs of numbers describe it, and they look inconsistent until you see what each one measures:
- The lines end at the final month. Read the last point of each line and you get $570 (actual Ozempic) vs. $690 (expected) — that’s where the chart’s end labels come from.
- The subtraction uses the average of all six “after” months. Averaged over the whole after period, Ozempic landed at $630 vs. $750 expected. We use the average because a single month is noisy — one expensive claim can move it — and the study’s answer shouldn’t hinge on one month.
Both views tell the same story: the gap between actual and expected is $120 a month either way. And because that gap is the same in every after month, each labeled point on the dashed line sits exactly $120 above the Ozempic group’s actual cost that month. That gap is the number the whole study exists to estimate.
The chart is Step 1 drawn as lines: it plots the shaded “average per member” column for both groups across all twelve months, so you can see the month-by-month trends that the four summary numbers compress.
Monthly obesity-related cost — group averages
Every point on these lines is one month’s average per member figure — the shaded last column of the Step 1 tables above. The teal line is the Ozempic group’s column; the ochre line is the other-drug group’s column. The dashed line is the Ozempic group’s expected path [counterfactual] — every one of its after-period points is labeled, and each sits exactly $120 above the Ozempic group’s actual cost that month: the extra fall the subtraction attributes to Ozempic.
Read the chart the way the study does. The two groups don’t start at the same place — Ozempic starters were already costlier ($900 vs. $700 a month), probably because costlier, more complex members are the ones who get the newer drug. So comparing only the “after” numbers ($630 vs. $550) would be rigged. Instead, look at the drop: both groups fall (the other drug helps too), but the Ozempic group falls further. That extra fall is the answer to our question.
Doing this with real claims and enrollment data
- Look up enrollment for everyone, before any cost math [continuous enrollment requirement] — for each candidate member, check the enrollment records and confirm coverage spans the entire relevant time: all 6 months before and all 6 months after the first fill. Members with a coverage gap, or who disenroll partway through the window, are excluded — under the same rule in both groups — because for them a $0 month could mean “not covered” rather than “no care,” and their before/after comparison would be built on uneven observation.
- The divisor is the group size, and it stays fixed. In the toy example each group always has 3 members, enrolled for all 12 months. Real data works the same way once the enrollment requirement is applied: every included member contributes to every month, so each month’s group total is divided by the same number of members — that is why every figure in this method is expressed as an average per member [per member per month · PMPM], never as a raw group total.
- Zero-claim months stay in. A member who was enrolled — verified against the enrollment records — but filed no obesity-related claim in a month contributes $0 to that month’s total and still counts in the divisor. Dropping quiet months would inflate every average and break the comparison.
- Say plainly whom the requirement leaves out. Requiring a full 12 months of enrollment narrows the study to stably enrolled members, and members who lose coverage may differ from those who keep it. Apply the rule identically to both groups, before looking at any outcomes, and report how many members it removed from each group.
What would make us trust — or doubt — the answer
1 · The before picture has to look fair [parallel trends]
The whole method rests on one bet: if the two groups’ costs were already moving together in the six “before” months (as they do in the chart above), it’s reasonable to believe they would have kept moving together after month 0 if everything else were equal. If they were already drifting apart before anyone took anything, we stop — the comparison isn’t fair and no arithmetic fixes it. Here is how that fairness gets checked, not just eyeballed:
- Plot every before-month separately [event study] — six points per group before month 0, not one averaged slope. The gap between the two lines should look flat across those months, not steadily widening or narrowing.
- Test the before-slopes against each other [pre-trends test] — fit each group’s before-period trend and check whether the two slopes differ by more than ordinary month-to-month noise would explain.
- Put a range on any unfairness — don’t just pass or fail it [equivalence check]. “No significant difference” on its own is weak evidence. What we actually report is a range for the slope gap [confidence interval], and the check is whether even the worst end of that range is small next to the effect we’re claiming — here, $120 a month.
- Run a fake version of the study [placebo test] — pretend everyone started six months earlier than they really did and rerun the same arithmetic on before-period data only. A fair design should find an “effect” of about $0. If it finds one, the comparison was never fair to begin with.
2 · The groups start different, and we know it [confounding by indication]
Ozempic starters cost more at baseline — $900 vs. $700 a month — probably because costlier, more complex members are the ones who get the newer drug. Comparing changes removes any gap that stays constant, but if the groups differ in ways that change over time (for example, more members with diabetes in one group), that can still tilt the answer. So before anyone looks at the after-period, we rebuild the comparison group to resemble the Ozempic group:
- Match or weight on the starting picture [propensity score matching / weighting] — using only before-period data, pair each Ozempic starter with other-drug starters of similar age, sex, conditions, and prior costs — or weight members so the two groups’ starting profiles line up numerically.
- Prove the rebuild worked [covariate balance] — compare the groups’ starting characteristics side by side after matching. The working rule is that remaining gaps should be tiny [standardized mean difference below 0.1]. If they don’t balance, we fix the match or narrow the study population — we don’t proceed to the answer.
- Then run the same three subtractions on the matched groups [difference-in-differences on a matched sample] — matching handles the differences we can see at the start; comparing changes handles the shared forces that move both groups over time. Each method covers the other’s blind spot.
The bottom line
We can’t run the ideal trial — but by comparing members who started Ozempic with members who started a different weight-loss drug, and comparing how each group’s costs changed from its own starting point, we get the closest honest answer claims and enrollment data can give: whether Ozempic lowers the cost of obesity care more than the alternative.
All member names and dollar figures on this page are a made-up teaching example, not real member data.