A statistical framework for jointly modeling day-3 parasite positivity and PCR-corrected ACT treatment failure to separate shared early-clearance and regimen-specific late-efficacy signals in African WHO therapeutic-efficacy studies.
# Component-resolved Joint latent-component modeling of ACT therapeutic-efficacy surveillance
R code and analytic data for the study:
**Component-resolved Joint latent-component modeling of early parasite response and final ACT efficacy in African therapeutic-efficacy surveillance**
The analysis jointly models day-3 parasite positivity and PCR-corrected per-protocol treatment failure in African *Plasmodium falciparum* therapeutic efficacy studies of artemether-lumefantrine, artesunate-amodiaquine, and dihydroartemisinin-piperaquine.
## Requirements
The reported analysis uses R 4.4.0-compatible code and the `Matrix` package.
```r
install.packages("Matrix")
```
## Repository structure
- `R/joint_model.R`: joint latent-component likelihood, estimation, uncertainty, latent-component estimates, and prediction functions.
- `data/who_tes_dual_endpoint.csv`: analytic WHO therapeutic-efficacy dataset used in the study.
- `analysis/descriptive_summary.R`: cohort summaries, threshold states, era summaries, and cross-regimen concordance.
- `analysis/fit_model.R`: primary model fit, likelihood-ratio test, latent-component estimates, and sample-size sensitivity analysis.
- `analysis/robustness_checks.R`: five-fold final-endpoint validation, forward temporal validation, and leave-one-country-out stability analysis.
- `simulation/run_simulation.R`: threshold-balanced Monte Carlo study.
- `analysis/make_figures.R`: figure generation.
- `tests/validate.R`: numerical and data-integrity checks.
- `reference/`: numerical results from the reported analysis.
- `run_all.R`: complete workflow.
## Quick reproducibility check
From the repository root:
```bash
Rscript run_all.R quick
```
The quick workflow fits the complete empirical model, runs a reduced threshold-balanced simulation, generates figures, and performs numerical validation.
A successful run ends with:
```text
All validation checks passed
quick workflow completed successfully.
```
## Complete reproduction
Run the …