Chapter 01
Introduction: Why Predictive Modelling with RWD Is Harder Than It Looks
Predictive modelling with real-world data promises a great deal: earlier identification of patients likely to respond to treatment, more accurate commercial forecasts, smarter allocation of clinical development resources. The promise is genuine. The gap between that promise and what most pharma teams actually deliver is also genuine — and it is almost always a data problem rather than a modelling problem.
The most sophisticated machine learning architecture in the world cannot compensate for a training dataset that misclassifies patients, has insufficient longitudinal depth to capture the outcomes being predicted, or contains systematic biases that the model learns and amplifies rather than corrects. Outcome prediction models built on claims data fail not because the methodology is wrong but because the data specification was inadequate — and because the validation framework did not detect the problem before the model was deployed.
This guide addresses three questions that every pharma data science team working with real-world data for predictive modelling needs to answer before writing a single line of model training code:
- What makes a real-world dataset suitable for predictive model training — and what disqualifies one?
- How do you validate a model trained on claims data against clinical outcomes in a way that regulatory bodies and internal stakeholders will accept?
- Where does synthetic data genuinely help, and where does it introduce risks that undermine the model's clinical and commercial credibility?
Core Principle
Specify dataset requirements before selecting a data source — not after. The decisions that determine whether a predictive modelling programme delivers value are made at the beginning, in dataset selection, outcome labelling, feature specification, and validation framework design — not during model training or after deployment.
Chapter 02
The Three Primary Use Cases — and What Each Requires from the Data
Predictive modelling in pharma clusters around three primary use cases. Each has distinct data requirements that need to be specified before data source evaluation begins. Treating them as variations on the same analytical problem is one of the most reliable ways to build a model that fails in deployment.
2.1 Patient Stratification
Patient stratification models use real-world data to identify which patients within a disease population are most likely to progress, respond to a specific treatment, experience adverse events, or transition to a higher cost-of-care tier. The commercial applications are significant — from targeting clinical trial recruitment to prioritising field force engagement to identifying patients most likely to benefit from a new therapy at launch.
Data Requirements for Stratification Models
- Sufficient longitudinal depth to observe patient trajectories over the relevant follow-up horizon
- Complete diagnostic coding across the full comorbidity profile, not just the primary indication
- Prescription and treatment history with date precision adequate for sequence analysis
- Outcome data with enough granularity to define the stratification endpoint clearly
- Population coverage broad enough to ensure the training cohort is representative of the target population, not just the patients who present most frequently to high-coding institutions
⚠ Common Failure Mode
Training on a dataset that over-represents high-utilisation patients — those with the most complete records — and under-represents patients who disengage from the healthcare system before reaching the outcome the model is designed to predict. The model learns to identify patients who look like high-utilisers, not patients who will actually experience the outcome. This is a dataset selection problem, not a modelling problem, and it cannot be fixed after the fact.
2.2 Treatment Response Prediction
Treatment response prediction models estimate the probability that a given patient will respond to a specific therapeutic intervention, based on their baseline characteristics, prior treatment history, and real-world outcome patterns in similar patients. These models are increasingly used to support label expansion submissions, personalised medicine programmes, and market access negotiations where payer evidence requirements include subgroup response data.
Data Requirements for Treatment Response Prediction
- Validated phenotype algorithms for both the patient population and the treatment exposure — misclassification at either level propagates directly into the model's response estimates
- Adequate follow-up to capture the full response window — a model trained on data with insufficient follow-up will systematically underestimate response rates for treatments with delayed onset of effect
- Covariate completeness for the confounders most likely to explain treatment assignment — claims data captures some confounders well and others poorly, and the gap needs to be understood before model training begins
- External validation dataset from a different data source or geographic market — internal validation on a held-out test set from the same claims database is insufficient for regulatory or market access purposes
Methodological Link
Treatment response prediction is the use case where the connection to phenotype algorithm quality is most direct. A model trained on a poorly validated patient cohort produces response estimates that are statistically precise but clinically meaningless. Sensitivity, specificity, and PPV of the outcome algorithm set the upper bound on model performance before a single training epoch begins.
2.3 Commercial Forecasting
Commercial forecasting models use real-world prescription data, treatment patterns, and market dynamics to project brand performance, estimate market share trajectories, and support launch planning and loss-of-exclusivity modelling. This is the use case where data recency matters most and longitudinal depth matters least — the predictive horizon is typically measured in quarters, not years.
Data Requirements for Commercial Forecasting
- Near-real-time prescription data with update frequency adequate for the forecasting horizon
- Geographic coverage across the markets being forecast, with consistent coding across markets
- Treatment pattern data that captures switching, discontinuation, and line-of-therapy transitions at the level of granularity the forecast model requires
- Historical data sufficient to capture at least one full market cycle — typically three to five years for an established market, longer for markets with significant seasonal or policy-driven variation
Commercial forecasting is also where synthetic data augmentation has its most straightforward application — scenario modelling for launch conditions, competitive entry events, and policy changes that have not yet occurred can be structured as synthetic data generation problems without the clinical validity constraints that apply to treatment response prediction.
Chapter 03
What Makes a Claims Dataset Suitable for Predictive Model Training
Predictive models do not just describe the data — they learn its patterns, including its biases, gaps, and systematic distortions. A dataset that produces acceptable descriptive statistics may produce a deeply flawed predictive model if its structural characteristics are not evaluated carefully before training begins.
3.1 Feature Completeness and Covariate Coverage
A predictive model is only as good as the features it can access. For claims-based models, that means evaluating whether the dataset captures the variables most predictive of the outcome of interest with sufficient completeness and accuracy. Claims data captures billing events reliably. It captures clinical detail poorly. For many prediction tasks, important predictive features — disease severity, functional status, laboratory values, physician assessment — are either absent or proxied through indirect indicators that introduce noise into the model.
Before committing to a claims dataset for model training, map the features your model architecture requires against what the dataset actually contains. For each important feature not directly available in claims, assess whether a credible proxy exists, what bias that proxy introduces, and whether that bias is directional — systematic enough to be corrected — or random, meaning noise that simply reduces model performance.
Completeness analysis requires particular care in clinical datasets because missing values rarely occur randomly. A missing laboratory value may indicate a test was not performed — a clinically meaningful signal — or a result that was not recorded, which is an administrative artefact. These two scenarios require fundamentally different imputation approaches and affect model validity differently. Standard missing data analysis that treats both scenarios identically introduces systematic errors that compromise model generalisability. Structured completeness protocols that distinguish between clinically significant missingness and administrative gaps are a prerequisite for reliable clinical ML dataset preparation.
3.2 Outcome Definition and Labelling Quality
Supervised machine learning models require labelled outcomes — patients who experienced the event of interest, correctly identified and correctly timed. In claims data, outcome labelling quality depends directly on phenotype algorithm performance. A poorly validated outcome algorithm produces training labels that are systematically wrong, and a model trained on systematically wrong labels learns to predict the algorithm's misclassification pattern rather than the clinical outcome.
Key Principle
The same rigour applied to phenotype algorithm validation for observational studies needs to be applied to outcome labelling for predictive model training.
Sensitivity, specificity, and positive predictive value of the outcome algorithm determine the upper bound on model performance — no amount of architectural sophistication recovers from a 70% PPV outcome label.
3.3 Temporal Structure and Data Leakage Prevention
Data leakage — the inadvertent inclusion of future information in model training features — is one of the most common and most consequential errors in predictive modelling with longitudinal healthcare data. It is also one of the most reliably undetected errors in internal validation, because a leaked model performs well on any held-out set from the same data source where the leakage is present.
Preventing data leakage requires explicit specification of the prediction horizon and the feature observation window before model training begins. Every feature included in the model must be verifiably observable at the time of prediction — which in claims data means accounting for data latency, coding lag, and the time between clinical events and their appearance in the claims record.
⚠ Diagnostic Signal
A model that performs well in internal validation and dramatically worse in deployment is a data leakage problem until proven otherwise.
3.4 Population Representativeness and Bias Detection
Insurance-based patient cohorts systematically over-represent insured populations, high-utilisation patients, and patients treated at institutions with high claims completeness. For Pan-European applications, coding practices, treatment patterns, and healthcare utilisation vary enough across Continental European markets that a model trained on data from one market may require retraining or recalibration before deployment in another. Representativeness needs to be assessed against the deployment population explicitly — not assumed from headline coverage statistics.
Beyond geographic variation, non-randomised clinical data sources introduce selection biases that require explicit detection before model training begins. Claims-based datasets exhibit systematic biases related to insurance coverage type, healthcare access patterns, and diagnostic coding practices that vary across payer environments. A model trained without identifying these biases learns them as signal — and then reproduces them in deployment, performing well in populations that resemble the training data and poorly in those that don't.
Bias detection requires comparative analysis across demographic groups, geographic regions, and healthcare systems to identify systematic differences in data collection, coding practices, and patient representation. Variable quality evaluation should also examine data entry patterns that create artificial correlations — default value insertion, copy-paste errors in EHR workflows, and systematic under-coding in specific care settings are common sources of dataset-level bias that are invisible in aggregate quality statistics but material to model performance.
3.5 AI-Readiness Beyond Standard Data Quality
A dataset that meets conventional data quality standards — complete, accessible, interoperable, reusable — is not necessarily AI-ready in the sense that matters for predictive model training. AI-ready clinical datasets require additional characteristics that standard quality frameworks don't address: deep provenance tracking that enables complete lineage from original data collection through every transformation step; statistical validation of distribution characteristics that affect model performance across different patient populations; semantic consistency in how clinical concepts are coded across time periods and care settings; and pre-model explainability documentation that supports regulatory audit requirements.
Regulatory Implication
A model whose training data cannot be traced back to its original source — with every transformation documented — will not survive regulatory scrutiny regardless of its predictive performance.
Building provenance documentation into the data preparation process rather than reconstructing it after the fact is substantially more reliable and less expensive.
Chapter 04
Validating Models Trained on Claims Data Against Clinical Outcomes
Internal validation — splitting the training dataset into training and test sets and evaluating performance on the held-out test set — is necessary but entirely insufficient for any model intended to support regulatory submissions, market access negotiations, or clinical decision-making.
4.1 The Four-Level Validation Hierarchy
Internal validation confirms that the model has learned genuine patterns rather than overfitting the training data. Standard approaches — k-fold cross-validation, bootstrapping — are appropriate here. Internal validation tells you whether the model works on data from the same distribution as the training set. It tells you nothing about whether it will work on data from a different distribution.
Temporal validation tests the model on data from a later time period than the training set, using the same data source. This assesses whether the model's learned patterns are stable over time. Claims data is particularly susceptible to temporal instability because coding practices, treatment guidelines, and healthcare system characteristics change over time.
External validation tests the model on data from a different source — a different claims database, a different geographic market, or ideally a clinical dataset that provides outcome labels derived from chart review rather than administrative coding. External validation is the standard required for regulatory submissions and should be considered the minimum acceptable validation for market access applications.
Clinical validation confirms that model predictions correspond to actual clinical outcomes in a prospective or quasi-prospective setting. This is the most demanding validation level and is required for any model that will directly influence clinical decision-making.
Regulatory Standard
A model that has only been internally validated has not been validated in any meaningful regulatory sense. External validation against a different data source is the minimum requirement for models supporting regulatory submissions or formal market access applications.
4.2 Performance Metrics That Matter
Accuracy is not an adequate performance metric for imbalanced healthcare outcome datasets. A model that predicts "no event" for every patient will achieve high accuracy on a dataset where 95% of patients do not experience the outcome. That model is analytically worthless.
For patient stratification and clinical decision support: discrimination (AUROC), calibration (Brier score, calibration curves), and net benefit analysis (decision curve analysis) are the relevant performance measures. Regulators and HTA bodies increasingly expect calibration evidence alongside discrimination evidence — a model that discriminates well but is poorly calibrated assigns systematically incorrect probabilities to patients, undermining clinical utility regardless of AUROC.
For commercial forecasting: forecast accuracy metrics — mean absolute percentage error, symmetric MAPE, prediction interval coverage — are more relevant than clinical discrimination metrics.
4.3 Reporting Standards
The TRIPOD (Transparent Reporting of a Multivariable Prediction Model for Individual Prognosis or Diagnosis) statement provides the reporting standard for prediction model development and validation studies. TRIPOD+AI extends this to machine learning models. FDA guidance on artificial intelligence and machine learning in software as a medical device establishes additional requirements for models used in clinical contexts. Any model intended for regulatory submission or market access support should be developed and reported against these standards from the outset.
Chapter 05
Where Synthetic Data Helps and Where It Creates Risk
Synthetic data has genuine and growing applications in pharmaceutical predictive modelling. It also has limitations that are frequently understated by vendors and overstated by advocates. Understanding both clearly is necessary for making sound decisions about where synthetic data fits in a predictive modelling programme.
5.1 Where Synthetic Data Genuinely Helps
Training data augmentation for rare outcomes. When the outcome of interest is rare in the available real-world dataset, GAN-based generation with differential privacy guarantees can augment the training set to improve model performance on the minority class without exposing individual patient records to GDPR Article 9 constraints.
Algorithm development and testing under GDPR constraints. Developing and testing predictive model architectures on patient-level claims data triggers Article 9 obligations across Continental European markets. Synthetic data allows algorithm development to proceed without those constraints before being trained on the real dataset under appropriate data governance frameworks.
Scenario modelling for commercial forecasting. Generating synthetic patient trajectories consistent with assumed market conditions — competitive entry, policy changes, guideline updates — extends the analytical reach of commercial forecasting models beyond the historical data available in the training set. This is the application with the fewest regulatory constraints and the clearest analytical value.
5.2 Where Synthetic Data Creates Risk
⚠ Regulatory Position
Neither FDA nor EMA currently accepts synthetic data as the primary evidence base for regulatory submissions requiring predictive model validation. Synthetic data can support supplementary analyses, sensitivity analyses, and scenario modelling — but the core validation evidence must come from real patient-level data with documented provenance.
Primary training for clinical prediction models. The synthetic generation process preserves statistical relationships present in the source claims data — but those relationships are derived from billing patterns, not clinical ground truth. A model trained primarily on synthetic data has not been trained on clinical reality.
Calibration failure. Even where synthetic data produces well-discriminating models, calibration — the correspondence between predicted probabilities and observed event rates — is frequently compromised. Synthetic generation processes optimise for distributional similarity, not for the precise probability relationships that calibration requires. Models intended for clinical use should not rely on synthetic data for calibration validation.
Chapter 06
Dataset Evaluation Checklist Before Model Training Begins
Before committing to a dataset for predictive model training, work through these evaluation criteria explicitly. Document the answers — the documentation becomes part of the model's validation evidence.
- Phenotype algorithm validation: Has the patient population algorithm been validated against gold-standard clinical records? What are the sensitivity, specificity, and PPV? Has the outcome labelling algorithm been validated with the same rigour?
- Feature completeness: Are the features most predictive of the outcome of interest present in the dataset with adequate completeness? For absent features, what proxies are available and what bias do they introduce?
- Temporal structure: Is the dataset structured to support the prediction horizon required? Has data leakage risk been assessed and controlled for each feature in the model?
- Longitudinal depth: Is follow-up duration sufficient to capture the full outcome window for the prediction task? Is follow-up continuity documented, or are there gaps that create informative censoring?
- Population representativeness: Is the training population representative of the deployment population? If not, what recalibration or reweighting approach will be used?
- Validation dataset availability: Is an external validation dataset available from a different source or geographic market? If not, what is the plan for external validation before deployment?
- Reporting standards compliance: Is the model development and validation plan structured to meet TRIPOD/TRIPOD+AI reporting standards? Has regulatory guidance on AI/ML been reviewed for the intended application?
- Synthetic data role: If synthetic data will be used, is its role limited to appropriate applications — augmentation, algorithm development, scenario modelling? Is the validation evidence base grounded in real patient-level data?
Getting Started
MEDDDICAL provides expert advisory on RWD strategy and data source evaluation for pharmaceutical and MedTech companies across Continental European markets. If you are scoping a predictive modelling programme and want an independent assessment of your dataset requirements and validation framework before entering vendor conversations, contact us to discuss your specific evidence requirements.
https://predictivemodeling.medddical.com
https://medddical.com/contact/
— References
References and Further Reading
Reporting Standards
Collins GS, et al. Transparent reporting of a multivariable prediction model for individual prognosis or diagnosis (TRIPOD): the TRIPOD statement. BMJ 2015;350:g7594. https://www.bmj.com
Moons KGM, et al. PROBAST: a tool to assess the risk of bias and applicability of prediction model studies. Annals of Internal Medicine 2019;170(1):51–58. https://www.acpjournals.org
Validation Methods
Wynants L, et al. Prediction models for diagnosis and prognosis of Covid-19: systematic review and critical appraisal. BMJ 2020;369:m1328. https://www.bmj.com
Vickers AJ, Elkin EB. Decision curve analysis: a novel method for evaluating prediction models. Medical Decision Making 2006;26(6):565–574. https://journals.sagepub.com
Synthetic Data
Jordon J, et al. Synthetic data in machine learning for medicine and healthcare. Nature Biomedical Engineering 2021;5:493–497. https://www.nature.com
Chen RJ, et al. Harnessing the power of synthetic data in healthcare: innovation, application, and privacy. npj Digital Medicine 2023. https://www.nature.com
Regulatory Guidance
U.S. Food and Drug Administration (2021). Artificial intelligence and machine learning (AI/ML)-based software as a medical device (SaMD) action plan. https://www.fda.gov
U.S. Food and Drug Administration (2024). Real-world data: assessing electronic health records and medical claims data to support regulatory decision-making for drug and biological products. https://www.fda.gov
ISPOR-ISPE Special Task Force. Good practices for real-world data studies of treatment and/or comparative effectiveness. https://www.ispor.org
Study Design
Hernán MA, Robins JM. Using big data to emulate a target trial when a randomized trial is not available. American Journal of Epidemiology 2016;183(8):758–764. https://academic.oup.com/aje