Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2026 Jul 26.
Published in final edited form as: Ann Epidemiol. 2026 Mar 30;119:110082. doi: 10.1016/j.annepidem.2026.110082

Early adherence predicts treatment outcomes and mortality in people living with HIV and multidrug-resistant tuberculosis

Kevin J Guzman 1, Rubeshan Perumal 2,3, Allison Wolf 1, Xuan Lu 1, Resha Boodhram 2, Boitumelo Seepamore 2,4, Karl Reis 5, Matthew J Cummings 1, K Rivet Amico 6, Ying Kuen Cheung 7, Gerald Friedland 8, Jennifer Zelnick 9, Amrita Daftary 2,10, Nesri Padayatchi 2, Kogieleum Naidoo 2, Max R O’Donnell 1,2,11
PMCID: PMC13401231  NIHMSID: NIHMS2163564  PMID: 41921598

Abstract

Purpose

Treatment success for RR/MDR-TB remains suboptimal, particularly among people living with HIV. Electronic dose monitors support adherence, but strategies to act on these data are limited. We hypothesized that early adherence to bedaquiline predicts treatment outcomes and could guide individualized interventions.

Methods

We prospectively enrolled adults with RR/MDR-TB and HIV initiating bedaquiline-containing regimens in KwaZulu-Natal, South Africa. Adherence was measured using real-time electronic dose monitors. Weekly adherence data through week 24 trained time-aware XGBoost models to predict end-of-treatment outcomes, and latent class growth analysis (LCGA) at the earliest predictive time point identified distinct adherence trajectories.

Results

Among 282 participants, model performance improved over time, achieving good discrimination by week 4 (AUC > 0.80), predictive of subsequent adherence. LCGA using 4-week data identified three adherence trajectories: high, moderate-stable, and early-declining. Favorable outcomes were lowest in the early-declining group (55% vs. 77% and 76%), which also had the highest mortality (36% vs. 12% and 12%). Cox models confirmed a higher risk of unfavorable outcomes among early decliners.

Conclusion

Adherence in the first four weeks of bedaquiline therapy provides a powerful, early signal of treatment outcomes. Real-time adherence monitoring could enable risk stratification and tailored interventions to improve RR/MDR-TB and HIV care.

Keywords: RR/MDR-TB, HIV, bedaquiline, medication adherence, latent class growth analysis, XGBoost

Introduction

Despite advances in diagnostics and the development of potent new therapies, rifampicin-resistant and multidrug-resistant tuberculosis (RR/MDR-TB) remains a global health threat, with treatment success rates unacceptably low (1,2). The crisis is especially severe among people living with HIV, who face unique clinical and structural challenges (3-6). Sustained adherence is essential for successful outcomes, yet nonadherence remains common, undermining treatment and fueling resistance (7,8).

Electronic dose monitoring devices (EDMs) have been introduced to support adherence, but results have been mixed. Results from large trials using EDMs for adherence support show that they can improve adherence but often fail to improve treatment outcomes, partly because they lead to only limited changes in clinical management (9,10). Other studies also support early non-adherence as a strong predictor of later medication discontinuation and poor treatment outcomes, underscoring the need to use EDMs proactively rather than reactively (11,12, 13). Identifying early windows when adherence is most prognostic could allow EDMs to guide timely, targeted interventions.

Time-aware extreme gradient boosting (XGBoost) leverages the sequential nature of longitudinal data to model how adherence evolves across treatment weeks (14,15). Rather than treating adherence as static, it incorporates cumulative weekly measures to identify the earliest predictive intervals. Complementing this, latent class growth analysis (LCGA) characterizes distinct adherence trajectories and their clinical implications (16). Using these approaches, we evaluated whether early bedaquiline adherence among people with RR/MDR-TB and HIV could identify actionable early signals of prognosis and subgroups most in need of differentiated support.

Methods

Study Setting and Participants

We analyzed baseline demographic factors, adherence, and treatment outcomes among individuals prospectively enrolled in the PRospective study of Adherence in M/XDR-TB Implementation Science (PRAXIS) study in KwaZulu-Natal, South Africa. A total of 370 adults with RR/MDR-TB and HIV initiating a bedaquiline-containing regimen were enrolled across two phases (ClinicalTrials.gov: NCT03162107/NCT04032730): a prospective cohort (n=199; November 2016–February 2018) and a randomized controlled trial (n=171; April 2018–April 2020). The intervention arm combined real-time EDM with psychoemotional counseling and support, while the comparison group received an enhanced standard of care (3,4,17). Eligibility required age ≥18 years, confirmed RR/MDR-TB, and concurrent ART initiation within four weeks if ART-naïve; exclusion criteria included pregnancy and incarceration.

For this analysis, we included 282 participants, with adherence monitored by EDM using the Wisepill RT2000 device and treatment outcomes recorded. Adherence to bedaquiline was measured over a 24-week period and MDR/RR-TB treatment outcomes were recorded up to 18-24 months from treatment initiation.

Treatment Outcomes

Outcomes were measured according to World Health Organization definitions (18). Favorable outcomes included treatment completion or cure, with cure defined as completion plus three consecutive negative cultures. Unfavorable outcomes comprised treatment failure (persistent culture positivity or clinical deterioration), death from any cause during treatment, or loss to follow-up (≥2 months of treatment interruption).

Bedaquiline Adherence and Feature Engineering

Weekly adherence was defined as the proportion of expected doses taken each week, as captured by the EDM, from the start of the study. To generate predictors for modeling, three features were calculated at each horizon k from the preceding three weeks: mean adherence, variance, and slope (ordinary least squares regression). Slopes were omitted if fewer than two observations were available. All features were constructed strictly using data up to week k, ensuring no future information contributed to earlier predictions.

Earliest Predictive Time

To evaluate whether early adherence patterns predicted end-of-treatment outcomes, we fitted a time-aware XGBoost model that, at each week of therapy, used only information accrued up to that week (19,20). To minimize temporal leakage, participants were split by chronological enrollment within the study phase into training and validation sets (70/30) (Table E1). The prediction target at each week was the WHO-defined end-of-treatment outcome among individuals still under observation (favorable vs. unfavorable).

Because early death, failure, or loss to follow-up both define an unfavorable outcome and truncate subsequent adherence measurement, it can lead to informative censoring and survivor selection bias. To address this, we applied inverse-probability-of-censoring weights (IPCW) beginning at week 2, the first point of informative censoring (Table E2) (21,22). Candidate predictors were drawn from baseline sociodemographic and clinical factors, with week-1 adherence and hospitalization added to capture early treatment effects. A multivariable logistic model retained predictors with p<0.10; the final model included week-1 adherence, week-1 hospitalization, baseline hospitalization, viral-load suppression, and income. Predicted censoring probabilities were converted to stabilized weights and applied in downstream analyses.

Predictors of the time-aware XGBoost model included baseline demographic factors (age, sex, body mass index, alcohol use, marital status [single, married, partnered], and Karnofsky score), HIV-related measures (baseline viral load suppression ≤200 copies/mL or undetectable), and treatment context variables (time from bedaquiline initiation to enrollment and baseline hospitalization status) (23). Time-varying predictors incorporated lagged adherence up to three weeks prior, as well as horizon-specific adherence summaries (mean, variance, slope). IPCW were applied as case weights during model training and performance evaluation to adjust for survivor selection bias. Hyperparameters were tuned globally using stratified cross-validation of the pooled training data (weeks 0–24), optimizing for AUPRC with AUROC as a secondary metric (Table E3). Model performance was evaluated with AUROC, AUPRC, sensitivity, specificity, F1 score, and Brier score calibration (24,25). The earliest actionable prediction horizon was defined as the first week in which AUROC >0.8 and Sensitivity >0.8 were achieved. The analytics workflow is summarized in Figure E1.

Prediction of Future Adherence

To evaluate whether early adherence predicted longer-term behavior, we examined adherence at the earliest predictive time point from the time-aware model in relation to subsequent adherence patterns. Adherence at this horizon was treated as a continuous variable and correlated with mean adherence across successive monthly intervals and with overall adherence through follow-up. Associations were assessed using Spearman correlation and linear regression.

Subgroups of Adherence Behaviors

We used LCGA to identify unobserved adherence trajectories at the earliest predictive horizon defined by the time-aware model (16). Model selection was guided by BIC, entropy, log-likelihood, and the Lo–Mendell–Rubin test (26,27). Classes with entropy >0.8 and representing at least 10% of participants were retained, with the final choice informed by both statistical fit and clinical plausibility (26,28). Participants were assigned to classes according to maximum posterior probability.

Treatment outcomes were compared across classes using WHO definitions, with differences assessed by Chi-square tests. Kaplan–Meier survival curves, pairwise log-rank tests, and Cox proportional hazards models with multivariable adjustment were used to estimate associations between class membership and unfavorable outcomes. Finally, we tested whether early adherence at the predictive horizon was differentially related to later adherence within each class using correlation and regression analyses.

Ethics Approval and Informed Consent

The study was approved by the Biomedical Research Ethics Committee of the University of KwaZulu-Natal, South Africa, and by the Institutional Review Board of Columbia University Irving Medical Center. All participants provided written informed consent before enrollment in the study.

Other Statistical Analysis

Baseline characteristics were summarized using descriptive statistics, with between-group comparisons conducted via t-tests, Wilcoxon rank-sum tests, and Chi-square tests. Analyses were performed in R (version 4.4.1) with RStudio (version 2024.12.0). Further details on the time-aware XGBoost models and LCGA are provided in the supplement.

Results

Participants

Among 282 participants, the median age was 36 years, and 53% were female (Table 1). Most had at least a secondary education, lived in multifamily households, and were unemployed. Socioeconomic vulnerability was common, reflected by low income, high household occupancy, frequent residence in informal settlements, receipt of government grants, and prior imprisonment. Substance use was prevalent, and just over half had suppressed HIV viral load at baseline. Most participants had independent functional status (Karnofsky ≥90), and EDM monitoring began a median of six days after bedaquiline initiation.

Table 1.

Baseline characteristics stratified by latent class membership

Baseline
Characteristics
Overall
N=282
Class 1
N=171
Class 2
N=78
Class 3
N=33
p-
value
Age (Years) 36 (29, 44) 36 (29, 43) 34 (29, 45) 34 (29, 45) 0.869
Gender – Male 133 (47%) 80 (47%) 35 (45%) 18 (55%) 0.639
Body Mass Index (kg/m2) 20.5 (18.2, 23.5) 20.4 (18.3, 24.3) 20.6 (18.4, 23.3) 19.7 (17.8, 21.9) 0.295
Level of Education 0.563
 No Schooling 8 (2.8%) 7 (4.1%) 1 (1.3%) 0 (0%)
 Primary, Attended 41 (15%) 21 (12%) 16 (21%) 4 (12%)
 Secondary, Attended 214 (76%) 130 (76%) 57 (73%) 27 (82%)
 College/University 19 (6.7%) 13 (7.6%) 4 (5.1%) 2 (6.1%)
Type of Housing 0.864
Single Family Home 43 (15%) 24 (14%) 14 (18%) 5 (15%)
Multifamily Home Informal 225 (80%) 139 (81%) 59 (76%) 27 (82%)
House/Homeless 14 (5.0%) 8 (4.7%) 5 (6.4%) 1 (3.0%)
Informal Settlement 39 (14%) 24 (14%) 12 (15%) 3 (9.1%) 0.742
Household Occupants 5.5 (4.0, 8.0) 5.0 (4.0, 8.0) 6.0 (3.0, 8.0) 5.0 (3.0, 8.0) 0.874
Marital Status 0.348
Married/Divorce/Widowed 31 (11%) 17 (9.9%) 11 (14%) 3 (9.1%)
 Partner/Girl/Boyfriend 33 (12%) 17 (9.9%) 9 (12%) 7 (21%)
 Single 218 (77%) 137 (80%) 58 (74%) 23 (70%)
Number of Children 2.0 (1.0, 3.0) 2.0 (1.0, 3.0) 2.0 (1.0, 3.0) 2.0 (1.0, 2.0) 0.299
Employed 52 (18%) 27 (16%) 17 (22%) 8 (24%) 0.346
Monthly Income 2.10 2.1 2.00 3.50 0.076
(Thousands of Rand) (1.50, 3.75) (1.50, 3.70) (1.05, 3.05) (1.60, 4.50)
Receiving Grants 122 (44%) 80 (48%) 35 (47%) 7 (21%) 0.018
History of Imprisonment 33 (12%) 20 (12%) 9 (12%) 4 (12%) 1.000
Alcohol Use – Ever 162 (57%) 94 (55%) 48 (62%) 20 (61%) 0.578
Smoking – Ever 112 (40%) 64 (37%) 32 (41%) 16 (48%) 0.475
Drug Use – Ever 36 (13%) 14 (8.2%) 14 (18%) 8 (24%) 0.009
Karnofsky Score ≥ 90 211 (75%) 132 (77%) 54 (70%) 25 (76%) 0.490
History of OI 54 (19%) 34 (20%) 13 (17%) 7 (21%) 0.794
HIV Viral Load 0.435
Suppressed 166 (61%) 106 (62%) 43 (60%) 17 (55%)
Days to EDM Monitoring 6 (1, 14) 4 (1, 14) 6 (2, 14) 7 (2, 13) 0.369
Hospitalized 250 (89%) 162 (95%) 64 (82%) 24 (73%) <0.001
Days Hospitalized 85 (61, 120) 79 (60, 115) 98 (71, 129) 77 (47, 114) 0.076
Readmitted 21 (7.4%) 9 (5.3%) 8 (10%) 4 (12%) 0.163

Abbreviations: OI = Opportunistic infection; EDM = Electronic Dose Monitoring.

Data are presented as median (interquartile range [IQR]) for continuous variables or n (%) for categorical variables. Continuous variables were compared using the Kruskal–Wallis test. Categorical variables were compared using the Chi-square test or Fisher’s exact test, as appropriate.

Treatment outcomes were favorable in 209 participants (74%). Death occurred in 43 (15%), 27 (10%) were lost to follow-up, and 3 (1%) experienced treatment failure. Adherence to bedaquiline was high overall, with a median of 96% (IQR 89–99%).

Earliest Prediction Time

We evaluated the performance of time-aware XGBoost models for predicting unfavorable treatment outcomes across weekly horizons from baseline (week 0) through week 24 (Figure E2, Tables E4-E6). At baseline, discrimination was moderate (AUROC 0.77, 95% CI 0.64–0.87) with limited sensitivity (0.54) but high specificity (0.85). Model performance improved as more adherence data accrued. By week 4, discrimination reached an AUROC of 0.80 (95% CI 0.69–0.90), with balanced sensitivity (0.80) and specificity (0.74), an F1 score of 0.68, and improved calibration (Brier score 0.16, relative reduction 0.25). The highest AUROC was observed at week 8 (0.89, 95% CI 0.80–0.95), and the best F1 score at week 8 as well (0.75).

Week 4 was selected as the earliest predictive horizon because it was the first time point to achieve an AUROC above 0.80 (0.80, 95% CI 0.69–0.90) with sensitivity greater than 0.80 (0.80, 95% CI 0.64–0.96) while maintaining balanced specificity (0.74, 95% CI 0.61-0.85) and stable calibration (Brier score 0.16) (Figure E3). Calibration plots at week 4 showed good agreement across risk quintiles (Figure E4). This combination reflects strong discrimination and accurate probability estimates at an early stage, allowing intervention. Subgroup performance at week 4 was consistent, with AUROCs of 0.75 in females, 0.82 in males, 0.72 in participants ≤35 years, and 0.83 in those >35 years (Table E7). Calibration remained robust across strata, underscoring the reliability of probability estimates.

Variable importance analysis demonstrated a shift from baseline characteristics (BMI, age, days to EDM initiation, undetectable HIV viral load) toward short-term adherence features by week 4. Mean adherence, variance, and slope over weeks 2–4 contributed measurable predictive value (Table E8).

Prediction of Future Adherence

Week 4 adherence was strongly correlated with subsequent adherence intervals (Figure E5, Table E9). The association was highest during weeks 5–8 (ρ = 0.87, slope = 0.93, p<0.001) and gradually declined but remained significant through week 24 (ρ = 0.55–0.72, all p<0.001). Across weeks 5–24, week 4 adherence was a strong overall predictor (ρ = 0.70, slope = 0.79, p<0.001), indicating that early adherence patterns were sustained over time.

Subgroups of Adherence Behaviors

Latent class growth analysis of adherence in the first four weeks identified a three-class solution with excellent fit (Table 2). Class 1 (n=171) showed consistently high adherence; Class 2 (n=78), moderate but stable adherence; and Class 3 (n=33), early and sustained declining adherence (Figure 1).

Table 2.

Model fit statistics for Latent Class Growth Analysis (LCGA) of weekly adherence (weeks 1–4)

Class BIC Entropy p-value N1 N2 N3 N4 N5
1 −693 — — 282 — — — —
2 −41579 1.00 <0.001 171 111 — — —
3 −41686 0.947 <0.001 171 78 33 — —
4 −41667 0.894 0.061 171 58 33 20 —
5 −41639 0.872 0.796 171 33 30 28 20

Abbreviations: BIC = Bayesian Information Criterion; Entropy = measure of classification certainty; p-value = significance of the Lo-Mendell-Rubin likelihood ratio test for k vs. k–1 class solution; N1–N5 = number of individuals assigned to each latent class.

Figure 1.

Figure 1.

Box plots depict the distribution of weekly bedaquiline adherence over the first four weeks of treatment, stratified by latent class membership. Class 1 maintained consistently high adherence (median ~100%), Class 2 showed moderately high adherence, and Class 3 demonstrated low and declining adherence. Boxes represent the interquartile range (IQR), whiskers indicate the full range excluding outliers, and horizontal lines denote median adherence. Class-specific mean adherence values are overlaid using shaped points: • for Class 1, ▲ for Class 2, and ■ for Class 3.

Baseline characteristics varied across classes (Table 1). Class 1 resembled the overall cohort, with 53% female, 48% receiving social grants, and low drug use (8%). Class 2 had similar demographics but higher alcohol (62%) and drug use (18%). Class 3 included majority men (55%), the highest drug use (24%), fewer receiving grants (21%), and lower hospitalization rates (73%).

Clinical outcomes also differed (Table 3). Favorable outcomes were common in Class 1 (77%) and Class 2 (76%), but were significantly lower in Class 3 (55%; p=0.023). Mortality was greatest in Class 3 (36% vs. 12% and 13% in Classes 1 and 2; p=0.002). Survival analyses confirmed higher risks of unfavorable outcomes in Class 3 (Figure 2, Figure 3, Figure E6).

Table 3.

Rifampicin-resistant/multidrug-resistant tuberculosis treatment outcomes by latent class membership

Overall Class 1 Class 2 Class 3
Events N=282 N=171 N=78 N=33 p-value
Favorable Outcome 209 (74%) 132 (77%) 59 (76%) 18 (55%) 0.023
Death 43 (15%) 21 (12%) 10 (13%) 12 (36%) 0.002
Lost to Follow-up 27 (9.6%) 17 (9.9%) 8 (10%) 2 (6.1%) 0.240
Treatment Failure 3 (1.1%) 1 (0.6%) 1 (1.3%) 1 (3.0%) 0.203

Data are presented as n (%). Outcomes were compared across latent classes using the Chi-square test or Fisher’s exact test, as appropriate.

Figure 2.

Figure 2.

Kaplan-Meier survival curves showing the proportion of individuals without unfavorable treatment outcomes over time (in days), stratified by latent class. Shaded regions indicate 95% confidence intervals. Class 1 had the highest probability of maintaining favorable outcomes throughout follow-up, while Class 3 experienced the poorest outcomes. The risk table displays the number of individuals at risk at each time point by class.

Figure 3.

Figure 3.

Forest plot displaying adjusted hazard ratios (aHRs) and 95% confidence intervals (CIs) for the risk of unfavorable treatment outcomes across latent adherence classes. Multivariable models were adjusted for age, gender, body mass index, marital status, receipt of government grants, alcohol use, smoking, drug use, viral load suppression status, Karnofsky performance score, time from bedaquiline initiation to study enrollment, hospitalization status, study aim, readmission, and total days admitted.

Adherence levels diverged sharply (p<0.001). Class 1 had a median adherence of 98% (IQR 95–100); Class 2, 93% (IQR 86–97); and Class 3, 81% (IQR 69–89). Correlations between week 4 and later adherence were not estimable in Class 1 due to limited variability. In Class 2, correlations were moderate for subsequent adherence between weeks 5 and 24 (overall ρ=0.50, p<0.001), while in Class 3, there was a strong correlation with subsequent adherence in weeks 5 to 24 (overall ρ=0.62, p<0.001) (Table E10, Figures E7-E9). Week 4 adherence was also correlated with subsequent adherence patterns at weeks 5 to 8, 9 to 12, 13 to 16, 17 to 20, and 21 to 24 for Classes 2 and 3.

Discussion

In this secondary analysis of prospectively collected data in individuals with RR/MDR-TB and HIV, we found that adherence behavior during the first four weeks of bedaquiline therapy provided a reliable and actionable signal of long-term outcomes. Using a time-aware XGBoost model, adherence in this early period predicted end-of-treatment outcomes and subsequent monthly adherence, demonstrating that short-term adherence behavior carries forward in clinically meaningful ways. Critically, week 4 emerged as the earliest treatment horizon, providing a practical window for clinical decision-making. These findings underscore that even brief windows of early monitoring provide a checkpoint for risk stratification and intervention (29,30).

Three distinct early adherence patterns emerged on LCGA. The largest group maintained consistently high adherence and achieved favorable outcomes, though not at the high levels reported in randomized controlled trials (31-34). A second group demonstrated moderate but stable adherence, with outcomes comparable to those of the high-adherence group, suggesting that some variability in early adherence may be tolerated under potent regimens anchored by bedaquiline, consistent with pharmacokinetic data showing a degree of regimen “forgiveness,” buffering against modest or short-term lapses in adherence (35). In contrast, the individuals with an early-declining adherence trajectory had persistently low adherence, the poorest outcomes, and an approximately threefold higher risk of death. Taken together with the week 4 decision point, these trajectories make the signal interpretable and targetable: maintain routine support for high/moderate-stable patterns, and escalate person-centered, differentiated support for early-declining individuals.

Our findings build on and extend a growing literature demonstrating the prognostic significance of early adherence patterns in TB treatment. A large pragmatic evaluation of EDMs across multiple countries found little direct impact on clinical outcomes, in part because monitoring was not paired with adaptive management strategies (9,10). Similarly, observational analyses of EDM data in China revealed that early nonadherence strongly predicted later TB treatment discontinuation (11). Importantly, Huddart et al. showed in the Philippines that adherence trajectories identified within the first 4–12 weeks of drug-resistant TB therapy were strongly associated with both six-month outcomes (36). Being in a moderate or low adherence trajectory increased the odds of poor outcomes by two to three times, and trajectory-based classification performed better than binary thresholds for predicting short-term outcomes. Our study complements these findings by demonstrating that such early signals remain robust even in a high-burden setting with concurrent HIV, using both trajectory analysis and machine learning.

Although modest differences in substance use and social grant receipt were observed, the adherence groups were otherwise socio-demographically similar. This highlights that early adherence trajectories add prognostic value beyond baseline clinical and demographic factors. While baseline factors retain predictive importance at treatment initiation, monitoring adherence over the first weeks offers an additional, actionable signal that can guide timely intervention (23, 37).

Taken together, these findings suggest that baseline demographic factors and early adherence behavior provide complementary signals of risk. Baseline factors such as poverty, substance use, and functional status can identify individuals with structural vulnerabilities at the time of treatment initiation. At the same time, EDMs capture how risk evolves through real-time behavior in the first weeks of therapy. Using both in combination could allow programs to allocate resources better, maintaining standard support for those with stable trajectories and directing intensified, person-centered interventions toward individuals with early-declining adherence. This integrated approach aligns with the broader shift toward differentiated service delivery in HIV and TB care, emphasizing timely, tailored support based on both structural and behavioral risk (29).

Our study has several strengths. It represents one of the largest prospective cohorts of RR/MDR-TB and HIV with high-resolution EDM adherence data, conducted in a real-world, high-burden setting. The combined use of time-aware machine learning and LCGA provided complementary insights: the former quantified the prognostic accuracy of early adherence windows, while the latter identified clinically meaningful subgroups of individuals with distinct risks. Together, these methods enhance interpretability and provide a practical framework for early risk stratification. Nonetheless, limitations should be acknowledged. The time-aware XGBoost model was trained on a moderate sample size, which may limit stability compared with larger machine learning applications; cross-validation and regularization mitigated overfitting, but external validation in other settings is essential. EDMs measure device openings rather than ingestion and may overestimate adherence, though they remain superior to self-report or pill counts (38). Residual confounding from unmeasured factors such as mental health, stigma, or adherence to companion drugs is also possible (7,39). Finally, while our analyses establish strong associations, pragmatic trials of week 4 support strategies are needed.

Our findings suggest several avenues for future research. First, integration of EDM-based risk stratification into national TB programs could be tested through pragmatic trials, with outcomes including mortality, treatment success, and cost-effectiveness. Second, combining EDM data with additional digital or biomarker tools (e.g., host-response assays, sputum monitoring) may further refine risk prediction. Third, implementation science approaches are needed to identify optimal ways of delivering differentiated interventions in resource-constrained settings, accounting for individuals preferences and health system realities.

Conclusion

Early adherence to bedaquiline, particularly within the first four weeks of therapy, is an actionable prognostic signal of treatment outcomes in RR/MDR-TB and HIV. Implementing a week 4 EDM checkpoint and escalating differentiated support for individuals with early-declining trajectories could reduce mortality, improve treatment success, and more efficiently allocate adherence resources. Future work should test week 4 activation in pragmatic, cost-effectiveness, and implementation studies across diverse settings.

Supplementary Material

1

Acknowledgments

The authors are thankful to the PRAXIS research team at the CAPRISA MRC HIV-TB Pathogenesis and Treatment Research Unit for their dedicated support and invaluable assistance in conducting and completing this study. We also acknowledge the participants and healthcare workers who participated in this work.

Funding

This work was supported by the National Institutes of Health (grant numbers R01AI124413, R01AI167795, 1L60A1194399, 2T32HL105323-06A1), the Stony Wold-Hurbert Fund (PT24-4036), the American Thoracic Society (PG014635-01), and the Burroughs-Wellcome Fund/Ravason Foundation (1467160). The funders had no role in the study design, data collection and analysis, decision to publish, or preparation of the manuscript.

Declaration of interests

The authors declare the following financial interests/personal relationships which may be considered as potential competing interests:

Kevin Jose Guzman reports financial support was provided by National Institute of Allergy and Infectious Diseases. Kevin Jose Guzman reports financial support was provided by Stony Wold Herbert Fund Inc. Kevin Jose Guzman reports financial support and travel were provided by American Thoracic Society. Kevin Jose Guzman reports article publishing charges and travel were provided by Burroughs Wellcome Fund. Max O’Donnell reports financial support, administrative support, article publishing charges, equipment, drugs, or supplies, and travel were provided by National Institute of Allergy and Infectious Diseases. If there are other authors, they declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Abbreviations

ART

Antiretroviral Therapy

AUPRC

Area Under the Precision-Recall Curve

AUROC

Area Under the Receiver Operating Characteristic Curve

BIC

Bayesian Information Criteria

CAPRISA

Centre for the AIDS Programme of Research in South Africa

EDM

Electronic Dose Monitoring

HIV

Human Immunodeficiency Virus

IPCW

Inverse Probability of Censoring Weights

IQR

Interquartile Range

LCGA

Latent Class Growth Analysis

LCA

Latent Class Analysis

RR/MDR-TB

Rifampicin-Resistant Multidrug-Resistant Tuberculosis

OI

Opportunistic Infection

PRAXIS

PRospective study of Adherence in M/XDR-TB Implementation Science

TB

Tuberculosis

WHO

World Health Organization

XGBoost

Extreme Gradient Boosting (machine learning algorithm)

Footnotes

CRediT Authorship Contribution Statement

Kevin J. Guzman: Conceptualization, Data curation, Formal analysis, Methodology, Investigation, Writing – original draft, Writing – review & editing.

Rubeshan Perumal: Conceptualization, Methodology, Supervision, Writing – review & editing.

Allison Wolf: Data curation, Formal analysis, Methodology, Writing – review & editing.

Xuan Lu: Data curation, Formal analysis, Writing – review & editing.

Resha Boodhram: Investigation, Data curation, Writing – review & editing.

Boitumelo Seepamore: Investigation, Data curation.

Karl Reis: Writing – review & editing.

Matthew J. Cummings: Conceptualization, Methodology, Writing – review & editing.

K Rivet Amico: Writing – review & editing.

Ying Kuen Cheung: Methodology, Writing – review & editing.

Gerald Friedland: Writing – review & editing.

Jennifer Zelnick: Conceptualization, Methodology, Writing – review & editing.

Amrita Daftary: Conceptualization, Methodology, Writing – review & editing.

Nesri Padayatchi: Conceptualization, Funding Acquisition, Investigation, Writing – review & editing.

Kogieleum Naidoo: Conceptualization, Supervision, Project Administration, Writing – review & editing.

Max R. O’Donnell: Conceptualization, Funding acquisition, Supervision, Project Administration, Writing – review & editing.

The authors declare no conflicts of interest related to this work.

Study Protocol and Analytic Code

The PRAXIS study protocol is publicly available (https://www.caprisa.org/Pages/CAPRISAStudies). Analytic code for the XGBoost models and LCGA is openly available (https://github.com/Guzmakev000/Time-Aware-XGBoost-Model---MDRTB-HIV-R). Deidentified data can be obtained from the corresponding author upon reasonable request. All modeling decisions, including specification, calibration, and validation, are reported in detail to support reproducibility and alignment with best practices.

Publisher's Disclaimer: This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.

References

  • 1.Naidoo K, Perumal R, Cox H, Mathema B, Loveday M, Ismail N, et al. The epidemiology, transmission, diagnosis, and management of drug-resistant tuberculosis – lessons from the South African experience. Lancet Infect Dis. 2024; 24 (9): E559–E575. [DOI] [PubMed] [Google Scholar]
  • 2.Global Tuberculosis Report 2024, 1st ed (Geneva: World Health Organization, 2024) [accessed April 28th, 2025]. Available from: https://www.who.int/teams/global-tuberculosis-programme/tb-reports/global-tuberculosis-report-2024. [Google Scholar]
  • 3.O’Donnell MR, Padayatchi N, Wolf A, Zelnick J, Daftary A, Orrell C, et al. Bedaquiline adherence measured by electronic dose monitoring predicts clinical outcomes in the treatment of patients with multidrug-resistant tuberculosis and HIV/AIDS. J Acquir Immune Defic Syndr. 2022;90(3):325–332. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Bateman M, Wolf A, Chimukangara B, Brust JCM, Lessells R, Amico R, et al. Adherence measured using electronic dose monitoring is associated with emergent antiretroviral resistance and poor outcomes in people with human immunodeficiency virus/AIDS and multidrug-resistant tuberculosis. Clin Infect Dis. 2022;75(9):1489–1496. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.O’Donnell MR, Nesri P, Daftary A, Orrell C, Dooley KE, Amico KR, et al. Antiretroviral switching and bedaquiline treatment of drug-resistant tuberculosis HIV co-infection. Lancet HIV. 2019;6(3):e201–e204. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Daftary A. HIV and tuberculosis: the construction and management of double stigma. Soc Sci Med. 2012;74(10):1512–1519. [DOI] [PubMed] [Google Scholar]
  • 7.Mallick JS, Nair P, Abbew ET, Van Deun A, Decroo T. Acquired bedaquiline resistance during the treatment of drug-resistant tuberculosis: a systemic review. JAC Antimicrob Resist. 2002; 4 (2): dlac029. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Nimmo C, Millard J, Brien K, Moodley S, van Dorp L, Lutchminarain K, et al. Bedaquiline resistance in drug-resistant tuberculosis HIV co-infected patients. Eur Respir J. 2020; 55 (6):1902383. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Goscé L, Sinha A, Leclercq C, Fekadu E, Rood E, Marks GB, et al. Modelling the epidemiological and economic impact of digital adherence technologies with differentiated care for tuberculosis treatment in Ethiopia. BMJ Glob Health. 2024;9(3):e014751. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Charalambous S, Maraba N, Jennings L, Rabothata I, Cogill D, Mukora R, et al. Treatment adherence and clinical outcomes among people with drug-susceptible tuberculosis using a medication monitor and differentiated care approach compared with standard of care in South Africa: a cluster randomised trial. Lancet Glob Health. 2024;12(7):e1053–e1064. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Stagg HR, Lewis JJ, Liu X, Huan S, Jiang S, Chin DP, Fielding KL. Temporal factors and missed doses of tuberculosis treatment: a causal associations approach to analyses of digital adherence data. Ann Am Thorac Soc. 2020;17(9):1142–1150. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Vernon A, Fielding K, Savic R, Dodd L, Nahid P. The importance of adherence in tuberculosis treatment clinical trials and its relevance in explanatory and pragmatic trials. PLoS Med. 2019;16(12):e1002884. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Liu X, Thompson J, Dong H, Sweeney S, Li X, Yuan Y, et al. Digital adherence technologies to improve tuberculosis treatment outcomes in China: a cluster-randomised superiority trial. Lancet Glob Health. 2023. May; 11 (5): E693–703. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Fang Z, Yang S, Lv C, An S, Wu W. Application of data-driven XGBoost model for the prediction of COVID-19 in the USA: a time-series study. BMJ Open. 2022;12:e056685. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Luo J, Zhang Z, Fu Y, Rao F. Time series prediction of COVID-19 transmission in America using LSTM and XGBoost algorithms. Results Phys. 2021;27:104462. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16.Herle M, Micali N, Abdulkadir M, Loos R, Bryant-Waugh R, Hubel C, et al. Identifying typical trajectories in longitudinal data: modelling strategies and interpretations. Eur J Epidemiol. 2020;35(3):205–222. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Daftary A, Mondal S, Zelnick J, Friedland G, Seepamore B, Boodhram R, et al. Dynamic Needs and Challenges of People with Drug-Resistant Tuberculosis in South Africa: a Qualitative Study. Lancet Glob Health 2021; 9:e479–88. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Definitions and reporting frameworks for tuberculosis – 2013 revisions (updated December 2014 and January 2020). Geneva: World Health Organization. [Accessed May 4, 2025]. Available from: https://iris.who.int/bitstream/handle/10665/79199/9789241505345_eng.pdf?sequence=1 [Google Scholar]
  • 19.Chen T, Guestrin C. XGBoost: a scalable tree boosting system. KDD Proc ACM SIGKDD Int Conf Knowl Discov Data Min. 2016;785–794. [Google Scholar]
  • 20.Liu S, Fu B, Wang W, Liu M, Sun X. Dynamic sepsis prediction for intensive care unit patients using XGBoost-based model with novel time-dependent features. IEEE J Biomed Health Inform. 2022;26(8):4258–4269. [DOI] [PubMed] [Google Scholar]
  • 21.Wooldridge JM. Inverse probability weighted estimation for general missing data problems. J Econom. 2007;141(2):1281–1301. [Google Scholar]
  • 22.Prince T, Bommert A, Rahnenfuhrer J, Schmid M. On the estimation of inverse-probability-of-censoring weights for the evaluation of survival prediction error. PLoS One. 2025;20(1):e0318349. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Guzman KJ, Wolf A, Perumal R, Cummings M, Zulu M, Zelnick J, et al. Socio-ecologic factors impacting medication adherence trajectories in patients with drug-resistant tuberculosis and human immunodeficiency virus [abstract]. Am J Respir Crit Care Med. 2025; 211:A1035. 10.1164/ajrccm.2025.211.Abstracts.A1036 [DOI] [Google Scholar]
  • 24.Bradley A. The use of the area under the ROC curve in the evaluation of machine learning algorithms. Pattern Recognit. 1997;30(7):1145–1159. [Google Scholar]
  • 25.Tharwat A. Classification assessment methods. Appl Comput Inform. 2021;17(1):168–192. [Google Scholar]
  • 26.Nylund KL, Asparouhov T, Muthén BO. Deciding on the number of classes in latent class analysis and growth mixture modeling: a Monte Carlo simulation study. Struct Equ Modeling. 2007;14(4):535–569. [Google Scholar]
  • 27.Cleux G, Soromenho G. An entropy criterion for assessing the number of clusters in a mixture model. J Classif. 1996;13:195–212. [Google Scholar]
  • 28.Yang CC. Evaluating latent class analysis models in qualitative phenotype identification. Comput Stat Data Anal. 2006;50(4):1090–1104. [Google Scholar]
  • 29.Ross J, Nachega JB, Haberer JE, Mncube S, Amico KR, Marais BJ, et al. Adaptive evaluation of mHealth and conventional adherence support interventions to optimize outcomes with new treatment regimens for drug-resistant tuberculosis and HIV in South Africa (ADAP-TIV): study protocol for an adaptive randomized controlled trial. Trials. 2023;24(1):776. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30.Tadesse AW, Mohammed Z, Foster N, Quaife M, McQuaid CF, Levy J, et al. Evaluation of implementation and effectiveness of digital adherence technology with differentiated care to support tuberculosis treatment adherence and improve treatment outcomes in Ethiopia: a study protocol for a cluster randomized trial. BMC Infect Dis. 2021; 21: 1149. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31.Nyang’wa BT, Berry C, Kazounis E, Motta I, Parpieva N, Tigay Z, et al. A 24-week, all-oral regimen for rifampin-resistant tuberculosis. N Engl J Med. 2022;387(25):2331–2343. [DOI] [PubMed] [Google Scholar]
  • 32.Conradie F, Diacon A, Ngubane N, Howell P, Everitt D, Crook A, et al. Bedaquiline–pretomanid–linezolid regimens for drug-resistant tuberculosis. N Engl J Med. 2020;382(10):893–902.32130813 [Google Scholar]
  • 33.Conradie F, Bagdasaryan T, Borisov S, Howell P, Mikiashvili L, Ngubane N, et al. Bedaquiline–pretomanid–linezolid regimens for drug-resistant tuberculosis. N Engl J Med. 2022;387(9):810–823. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 34.Guglielmetti L, Khan U, Velasquez GE, Gouillou M, Abubakirov A, Baudin E, et al. Oral regimen for rifampin-resistant fluroquinolone-susceptible tuberculosis. N Engl J Med. 2025; 392: 468–482. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 35.Fox GJ, Menzies D. A Review of the Evidence for Using Bedaquiline (TMC207) to Treat Multi-Drug Resistant Tuberculosis. Infect Dis Ther. 2013. Dec;2(2):123–44. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Huddart S, Geocaniga-Gaviola DM, Crowder R, Lim AR, Lopez E, Valdez CL, et al. Adherence trajectory as an on-treatment risk indicator among drug-resistant tuberculosis patients in the Philippines. PLoS One. 2022;17(11):e0277078. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 37.Marme G, Kuzma J, Zimmerman P, Harris N, Rutherford S. Investigating socio-ecological factors influencing implementation of tuberculosis infection prevention and control in rural Papua New Guinea. J Public Health (Oxf). 2024;46(2):267–276. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 38.Scott NA, Sadowski C, Vernon A, Arevalo B, Beer K, Borisov A, et al. Using a medication event monitoring system to evaluate self-report and pill count for determining treatment completion with self-administered, once-weekly isoniazid and rifapentine. Contemp Clin Trials. 2023;129:107173. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 39.Sharma R, Patel R, Shah N, Bhatt K, Mehta P, Jain A, et al. Prevalence and determinants of depression among multidrug-resistant (MDR) TB cases registered under National Tuberculosis Elimination Program in Ahmedabad City. Indian J Community Med. 2022;47(1):45–49. [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

1

RESOURCES