Tutorials › Propensity Score Matching and Instrumental Variables › Defining the Feature Space in Claims Data

Time-Varying and High-Dimensional Confounding · Tutorial 620 of 699

Defining the Feature Space in Claims Data

Learn to specify a defensible, pre-treatment claims feature space by defining its domains, observation windows, and eligibility rules.

Advanced 10 min read

What You'll Learn

  • Distinguish a candidate covariate domain from the individual variables later constructed from claims.
  • Set an index date and pre-treatment observation windows that align with treatment assignment.
  • Specify eligibility criteria that support comparable claims measurement in the target population.
  • Recognize how claims runout, enrollment gaps, and future-dependent rules can distort a feature set.
  • Compare broad claims-domain coverage with narrower, clinically targeted covariate definitions.

Why the Feature Space Starts With a Design Decision

A claims database may contain millions of diagnosis, procedure, medication, and utilization records. That volume does not determine which information belongs in a propensity-score model. Before deciding how to represent individual codes or select among candidate covariates, the analyst must specify which kinds of claims information are eligible to contribute, for which people, and during what time period. These choices define the feature space.

This step is consequential because claims data are generated by health-care use, insurance coverage, and billing practices as well as by underlying health. A feature set assembled without a time boundary can inadvertently include information recorded after treatment. An eligibility rule that requires future enrollment can also change the study population. Neither problem is fixed merely by fitting a more elaborate propensity model.

Definition: The feature space is the prespecified collection of candidate covariate domains and the rules that determine which claims records can contribute to them. A domain is a broad source or type of information, such as diagnoses, medication claims, procedures, or health-care utilization. The feature space is not yet a list of encoded variables: it establishes what information may be considered and the time and population boundaries for measuring it.

Let \(A_i\) indicate whether person \(i\) receives the treatment at the index date \(t_{0i}\), and let \(Y_i\) denote the outcome defined over a later follow-up period. A propensity score is the probability of treatment conditional on measured covariates. In this setting, the claims-based candidate covariates must be defined from information that precedes the treatment decision, not from claims generated during outcome follow-up.

$$ e(L_i)=P(A_i=1\mid L_i) $$

Here \(L_i\) denotes the covariates constructed from the permitted pre-index information. The earlier material on treatment prediction versus confounder control distinguishes a variable's ability to predict treatment from its causal role. Defining broad candidate domains does not establish that every eventual feature is a confounder, nor does it settle which features should enter a fitted model.

Specify the Time Boundary Before the Domains

The index date is the date at which treatment status is assigned or assessed for the study. The lookback window is the prespecified period before that date from which claims may contribute to baseline covariates. For example, a one-year lookback might include services with dates from 365 days before the index date through the day before it. State whether the endpoints are included; this avoids ambiguity at the boundary.

$$ \text{Permitted service dates for a 365-day lookback} = [t_{0i}-365,\;t_{0i}) $$

The right endpoint is open: a service dated on the index date is not in this pre-index window. This distinction matters when treatment and claims share a calendar date. If the ordering of events within that date is unknown, treating same-day claims as baseline information may allow treatment-period information into the covariates. A conservative rule is to exclude them from the baseline lookback or to define a clinically justified ordering using reliable timestamps.

Claims have at least two relevant dates: when a service occurred and when the claim was submitted, adjudicated, or made available in the analytic data. For causal covariates, the service date determines whether the care occurred before treatment. But a fixed data-extraction date and adequate claims runout are needed so that records from the end of the lookback are not selectively missing because they have not yet been processed. If the goal is to describe information available to a clinician at the decision point, additionally restrict to records actually available by that point; that is a different measurement target from retrospective ascertainment of pre-index care.

Worked Example: Applying a Lookback Window

Suppose a hypothetical patient has an index date of October 1, 2025, and the protocol uses a 180-day lookback ending the day before index. The candidate domains include diagnoses, medication claims, and outpatient visits. A diagnosis service is dated April 4, a prescription is dated April 5, and an outpatient visit is dated October 1.

The first permitted service date is April 4, 2025, because April 4 is 180 days before October 1 under this stated convention. Thus, the April 4 diagnosis and April 5 prescription are within the window. The October 1 visit is excluded because the window ends September 30:

$$ [\text{April 4, 2025},\;\text{October 1, 2025}) $$

This decision uses the service dates. If the April 4 diagnosis claim was adjudicated on October 10, it still describes a pre-index service, but it may not have been available to a decision-maker on October 1. The analyst should state whether the study targets retrospective measurement of pre-index care or only information available at treatment assignment, and ensure claims runout is sufficient for the selected target.

Choose Candidate Domains and State Their Scope

A domain specification should be broad enough to capture plausible baseline health and care patterns, yet concrete enough that another analyst could identify the records it includes. Common candidate domains in administrative claims include:

  • Diagnoses: inpatient and outpatient records indicating previously documented health conditions.
  • Procedures: records of prior diagnostic or therapeutic services.
  • Medications: pharmacy dispensing claims or medication-related medical claims, subject to the database's coverage.
  • Health-care utilization: visits, admissions, emergency care, and other measures of contact with the health system.
  • Care setting and provider: information about where and by whom care was delivered, when available and relevant.

For each domain, write down the included record sources, the allowed service-date range, and any important exclusions. For example, “medication claims” is incomplete if the database includes only outpatient pharmacy dispensings and not medications administered during hospital stays. Similarly, “diagnoses” needs a clear account of whether inpatient and outpatient claims are both in scope. These definitions describe the candidate information, not the later decisions about individual code representation.

The domain list should reflect the data-generating and care context. A database with no pharmacy benefit cannot support complete outpatient medication claims. A change in billing policy or coding system may also make a domain's measurement differ across calendar periods. Broad coverage is not the same as uniform measurement.

Worked Example: Building a Domain Specification

A hypothetical study compares initiation of a new outpatient therapy with initiation of an active comparator on January 1, 2026. The database contains medical claims and outpatient pharmacy claims, but no complete record of medications administered during hospital stays. The protocol uses a 365-day pre-index lookback.

A defensible initial domain specification is: (1) inpatient and outpatient diagnosis claims with service dates in the lookback; (2) inpatient and outpatient procedure claims in the same period; (3) outpatient pharmacy dispensing claims in the same period, explicitly excluding medication administrations not captured in the data; and (4) inpatient and outpatient utilization records in the same period. The rule applies to both treatment groups.

Each domain is bounded by the same index-relative interval, January 1, 2025 through December 31, 2025, and the study should use a data extraction date that permits adequate runout for those claims. This specification does not assert that all four domains are equally informative or that every record will become a separate model variable. It makes the candidate sources and their limitations explicit before that later work.

Eligibility Defines Who Can Be Measured

Eligibility rules identify the population to which the analysis is intended to apply and help ensure that candidate covariates have comparable opportunities to be observed. Typical rules include a defined treatment indication, age limits at index, observable enrollment during a baseline period, and availability of the benefits needed to capture the domains being used. The rule should be stated in terms of information and time points that are appropriate to the target population.

Continuous enrollment during the lookback is often used to make the observation period comparable: it reduces the chance that a person appears to have no prior diagnosis simply because the person was not insured in the database. If the candidate set includes outpatient medication claims, the required enrollment may need to include pharmacy benefits. A medical-only enrollment rule would not ensure comparable medication capture.

Eligibility is not a guarantee of complete measurement. People can receive care outside the captured system, and enrollment does not make every diagnosis equally likely to be recorded. The analyst should distinguish “no claim observed in the covered data” from “the person did not have the condition.” They are not interchangeable statements.

Worked Example: Evaluating an Enrollment Rule

Consider 1,000 hypothetical patients who meet the clinical treatment criteria. The protocol requires continuous medical and pharmacy enrollment during the 365 days before index. Claims show that 820 meet both coverage requirements; 100 have a gap in medical enrollment, and 80 lack pharmacy coverage for part of the year. The groups are mutually exclusive and sum to the full cohort: \(820+100+80=1{,}000\).

Under the stated rule, 820 patients are eligible for this analysis. The eligibility proportion is:

$$ \frac{820}{1{,}000}=0.820=82.0\% $$

The 180 exclusions are not evidence that those patients lacked relevant prior conditions or medications; their claims information is not observed with the required coverage. The rule is coherent if the target population is people continuously enrolled with both benefits for baseline ascertainment. It may limit generalizability to patients with interrupted or different coverage. The study should report this restriction rather than interpret the retained sample as automatically representative of all 1,000 patients.

Justification: Why the Pre-Index Cutoff Matters

A short argument explains why the temporal boundary is part of the design rather than a data-cleaning convenience. Suppose the candidate covariate is constructed only from services before index, and the treatment is assigned at index. Then the service contributing to the covariate cannot be a consequence of that treatment, provided the index date correctly marks treatment assignment and service dates are measured accurately. If services from after index are admitted, that guarantee disappears: treatment can affect subsequent care, which can in turn affect the recorded feature.

$$ \text{service date}<t_{0i} \quad\Longrightarrow\quad \text{service precedes index treatment} $$

The implication is a temporal safeguard, not proof that the measured covariate is a confounder or that all confounding has been controlled. It also relies on a well-defined index date and reliable service dates. When treatment initiation is identified from a claim, the treatment claim itself should not quietly be counted as baseline utilization or a baseline medication record unless the protocol explicitly defines a valid pre-treatment measurement.

1
Define the target cohort and index date.
State how treatment groups are identified and what date marks the treatment decision for each person.
2
Set the baseline interval.
Specify lookback length, endpoint convention, and how same-day claims are handled.
3
List candidate domains and data sources.
Identify what claims are included, what is unavailable, and whether coverage differs by domain.
4
Apply baseline eligibility rules symmetrically.
Check that rules support measurement for both treatment groups and do not depend on post-index information.
5
Document data maturity and missing coverage.
Confirm claims runout and describe what an unobserved claim can and cannot mean.

Diagnostics, Alternatives, and Limitations

Before constructing any features, audit the design. Tabulate the number and proportion of people meeting each eligibility rule, separately by treatment group. Compare enrollment duration, benefit coverage, and calendar-time distribution across groups. Check that the entire lookback precedes index for every person, that the selected data extract allows adequate runout, and that no eligibility condition refers to future survival, future enrollment, or outcome occurrence. A large treatment-group difference in eligibility or observable coverage is a warning that the analysis population or measurement process may differ substantially across groups.

A broad domain strategy can capture varied health and utilization signals that a narrow, manually selected clinical list might miss. The alternative is to predefine a smaller set of clinically targeted domains or covariates, which can be easier to interpret and less sensitive to inconsistent coding. Neither strategy is universally preferable: broad candidate coverage increases the amount of information considered, while narrow scope may omit relevant baseline differences. In either case, the time boundary, population, and source coverage still require explicit specification.

Important limitations remain. Claims are collected for reimbursement and administration, not as complete clinical records; an absent claim can reflect absent coverage, care outside the data, or lack of coding. Lookback length creates a trade-off: a longer interval may capture more history but also introduces older information and greater exposure to enrollment gaps or changes in coding. Eligibility restrictions can improve measurement while narrowing the population represented. Finally, a carefully defined feature space is a prerequisite for covariate construction, not a substitute for causal assumptions or balance and overlap assessment.

Common Pitfalls

  • Including post-index claims as baseline covariates. “Use all available claims” is not a valid time rule. Restrict candidate baseline information to the prespecified pre-index service window.
  • Treating no recorded claim as no disease. That conclusion ignores incomplete coverage and care outside the database. Describe it as no observed claim within the specified data and window.
  • Requiring future enrollment or survival. Such a rule can condition eligibility on post-treatment events and change the study population. Define baseline enrollment using the period before index unless the target design specifically justifies another rule.
  • Using a domain label without defining its coverage. “Medication history” can mean different things across databases. State which claims are captured and which are not.
  • Assuming identical observation just because the same dates were requested. Verify enrollment, benefits, data maturity, and capture across treatment groups.
Key takeaway: A defensible claims feature space is specified by a treatment-aligned index date, explicit pre-index windows, clearly bounded candidate domains, and eligibility rules that support comparable observation. These design choices define what can be measured; they do not by themselves establish that confounding has been removed.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. An index date is June 15, 2026, with a lookback from 90 days before index through the day before index. Is a service dated June 15 eligible? State the boundary rule.
  2. A study uses outpatient pharmacy claims but requires only continuous medical enrollment. What measurement problem may result, and what eligibility requirement could address it?
  3. Why is a diagnosis claim dated before index but adjudicated after index different from a diagnosis service dated after index?
  4. A cohort includes people only if they remain enrolled for six months after treatment. Why can this be problematic for defining the baseline feature space?

Solutions. (1) No. The right endpoint is open, so the lookback ends June 14; the June 15 service is on the index date. (2) Some patients may lack observable pharmacy benefits, so absence of a pharmacy claim may reflect missing coverage rather than no dispensing. Require pharmacy-benefit enrollment over the specified baseline window or narrow the domain accordingly. (3) The first service occurred before treatment and may be retrospectively observed with adequate claims runout, although it may not have been available to a decision-maker at index. The second service occurred after index and may be affected by treatment, so it is not a pre-treatment baseline service. (4) Future enrollment can depend on post-treatment events and excludes people based on information unavailable at baseline, potentially selecting the analysis population. Define baseline eligibility from pre-index coverage unless a justified target design requires otherwise.

Clinical Biostats