3.1. Propensity Score Modeling and Adjustment
To reduce confounding due to the non-random allocation of participants across the intervention and control arms in the cluster-randomized trial, we used propensity score (PS) modeling. Propensity scores estimate the probability of a participant receiving the intervention, conditional on the observed pre-treatment covariates. The propensity score was estimated via logistic regression, incorporating the earlier mentioned covariates selected based on theoretical importance and prior literature [
1,
8]. The results of this study are presented in tabular and graphical form as follows:
The red curve in
Figure 1 representing the intervention group consistently lies above the black curve for the control group throughout the follow-up period (up to ~84 weeks). This indicates that participants in the intervention group had a higher probability of remaining HIV-free over time compared to those in the control group. The divergence between the two curves becomes apparent within the first few weeks after birth. This suggests that the beneficial effect of the intervention began early and persisted over time. The intervention group’s curve levels off after around 20–30 weeks, implying that no additional HIV-related events (infections or deaths) occurred in that group after that point. This is a positive indicator of the intervention’s long-term effectiveness. In contrast, the control group’s curve continues to decline throughout the follow-up period, indicating a steady accumulation of HIV-related events over time in the absence of the intervention. These trends support the conclusion that the intervention (e.g., enhanced maternal or infant prophylaxis, better adherence strategies, or extended breastfeeding support) was effective in reducing HIV-related mortality or transmission in the postnatal period.
Table 1 presents the unadjusted Cox proportional hazards model for death outcomes. The variables are arm, age, education, travel time in minutes, and gestational age at enrollment. The arm is significant with a hazard ratio (HR) of 0.63, suggesting that the arm is associated with a lower hazard of death compared to the reference group. The concordance value is 0.542, indicating a moderate ability to discriminate between survivors and those who experienced the event. The likelihood ratio test is not significant (
p = 0.7), implying no strong evidence that the model is better than a simple null model.
Table 2 presents the unadjusted Cox proportional hazards model for HIV outcome. The variables are arm, age, educ.year1, travel.minutes, and gest.age.enroll. The arm is significant with a lower HR of 0.58, indicating a reduced hazard of death from HIV compared to the reference group. The concordance is 0.563, showing a moderate discriminatory ability. The likelihood ratio test is not significant (
p = 0.3), which is somewhat similar to the death model indicating no strong improvement over a simple model.
Table 3 presents the propensity score-adjusted model (mod.death.ps) for death outcomes. The variables are arm and lp.ps (propensity score). The results indicate that the arm remains significant with an HR of 0.72. The propensity score (lp.ps) is not significant (
p = 0.39), suggesting that adjusting for it does not substantially alter the hazard estimate for the arm. The concordance is 0.548, similar to the unadjusted model.
Table 4 presents the propensity score-adjusted model for HIV outcome. The variables are arm and lp.ps. The results show that the arm remains significant with an HR of 0.63. The propensity score (lp.ps) is not significant (
p = 0.607), similar to the death model, showing that adjusting for propensity scores does not substantially alter the hazard estimate for the arm. The concordance is 0.554, comparable to the unadjusted model for HIV survival.
Table 5 presents the results of the logistic regression model used to estimate propensity scores, representing the probability of assignment to the intervention group based on baseline covariates. Several covariates were significantly associated with intervention assignment. Specifically, mothers identifying as Nupe (
) or Other ethnicities (
) were significantly more likely to be in the intervention arm compared to the reference group (Gwari), suggesting that clinic catchment area characteristics may have influenced treatment allocation. Years of education (
) was negatively associated with being in the intervention group, indicating that mothers with less education were more likely to receive the intervention. Additionally, gestational age at enrollment (
) was positively associated with intervention assignment. Other variables, including maternal age, travel time, and timing of HIV diagnosis, were not statistically significant predictors of treatment assignment. These findings were used to compute a linear predictor (propensity score), which was subsequently included in the outcome models to adjust for baseline differences and reduce confounding.
3.3. Rationale for Covariate Adjustment Method
Given the limited number of outcome events (e.g., HIV infection or death), we opted to adjust for the propensity score as a covariate in the outcome model (as opposed to matching or inverse probability weighting) to preserve statistical power and reduce variance inflation. This approach is appropriate when the overlap is good and sample size constraints limit stratification or weighting methods.
The Martingale residuals plots in
Figure 2,
Figure 3,
Figure 4 and
Figure 5 for the variables “educ.year1”, “travel.minutes”, “gest.age.enroll”, and “age” were analyzed to assess the fit of a Cox proportional hazards model and to evaluate whether the proportional hazards assumption holds.
Figure 2 displays the Martingale residuals plotted against the continuous covariate years of education to evaluate the adequacy of its functional form in the Cox proportional hazards model. The residuals appear scattered randomly around the horizontal line at zero, and the smoothed red line shows only slight fluctuations, with no clear pattern of deviation from linearity. This suggests that the linear functional form of the education variable is appropriate and well-specified in the survival model.
The absence of a pronounced U-shape, curvature, or systematic trend implies that no transformation (e.g., logarithmic or polynomial) is necessary for this covariate. The model does not show strong evidence that education has a nonlinear relationship with the hazard of HIV infection or related outcomes. Despite its lack of statistical significance in the multivariable model, the Martingale residuals support the validity of retaining education in the model as a linearly entered covariate. These findings enhance confidence in the model specification, particularly in ensuring that the influence of education has not been misrepresented due to incorrect functional form assumptions.
Figure 3.
Martingale residuals for the variable “age”.
Figure 3.
Martingale residuals for the variable “age”.
Figure 3 shows the Martingale residuals plotted against maternal age to assess the suitability of its linear functional form in the Cox model. The residuals are spread relatively symmetrically around zero across the age range (
15–45 years), indicating no major model misfit. However, the red smoothed line (representing a lowess curve) reveals a slight U-shaped pattern, dipping below zero near age 28 and rising gradually beyond age 30. This suggests a mild non-linearity in the relationship between maternal age and the hazard of HIV infection or survival outcome.
While the pattern is subtle and does not reflect a serious violation, it indicates that the assumption of linearity may not fully capture the association between age and hazard. Nevertheless, due to the small number of outcome events in this dataset, a linear specification was retained in the final model for parsimony and interpretability. More flexible modeling strategies, such as restricted cubic splines or quadratic terms, may be appropriate in future studies with larger sample sizes to better capture potential non-linear age effects. In summary, the residuals support an approximately valid model specification for age, though future refinement may improve precision in estimating its effect.
Figure 4 presents the Martingale residuals plotted against travel time (in minutes) to assess the appropriateness of a linear functional form in the Cox proportional hazards model. The residuals are widely scattered across the range of travel times, with no clear upward or downward trend. The smoothed red line remains relatively flat and centered near zero, suggesting no systematic nonlinearity. This pattern indicates that the linear assumption for travel time is reasonably valid, and no transformation or alternative specification (e.g., splines or categorization) appears necessary.
While the variable was not statistically significant in the final adjusted model, the Martingale residual diagnostics confirm that its inclusion did not distort model validity or require functional form correction. In summary, these results support the use of travel time as a continuous linear covariate, appropriately specified within the Cox proportional hazards framework.
Figure 4.
Martingale residuals for the variable “travel.minutes”.
Figure 4.
Martingale residuals for the variable “travel.minutes”.
Figure 5 displays the Martingale residuals plotted against gestational age at enrollment to evaluate the functional form of this continuous covariate in the Cox proportional hazards model. The residuals are dispersed without a clear trend, and the smoothed red line fluctuates gently around zero across the full range of gestational ages. This suggests that the relationship between gestational age and the hazard function is approximately linear and that the variable is adequately modeled without requiring transformations.
Figure 5.
Martingale residuals for the variable “gest.age.enroll”.
Figure 5.
Martingale residuals for the variable “gest.age.enroll”.
No significant curvature or deviation is observed that would indicate the need for more complex modeling approaches, such as polynomial terms or splines. These diagnostics support the decision to retain gestational age as a linearly specified covariate in the model. Although it did not reach statistical significance in the adjusted model, its linearity and clinical relevance justify its inclusion. Overall, the Martingale residual pattern supports the validity of the linear specification for gestational age at enrollment in the survival analysis.
For “educ.year1” in
Figure 2, the smoothed line exhibits noticeable curvature, with an upward trend at lower values and a downward trend at higher values. This pattern suggests a potential violation of the proportional hazards assumption, indicating that the hazard ratio associated with “educ.year1” may not remain constant over time. Additionally, systematic clustering of residuals can be observed, implying that the model might not fully capture the relationship between “educ.year1” and the outcome. Addressing these issues may involve incorporating time-dependent effects or exploring nonlinear relationships.
In contrast,
Figure 4 for “travel.minutes” shows a relatively flat smoothed line across most of the variable’s range, suggesting that the proportional hazards assumption is likely satisfied for this predictor. The residuals are randomly scattered around zero, indicating no significant systematic patterns or model misspecification. While there is a slight upward trend at very low values of “travel.minutes”, this deviation is minor and does not strongly suggest a violation of assumptions. Overall, the model appears to fit the data well for “travel.minutes”, requiring no immediate adjustments.
For “gest.age.enroll” in
Figure 5 and “age” in
Figure 3, the smoothed lines reveal slight upward trends at lower values of the predictors, which level off as the variables increase. These trends indicate potential violations of the proportional hazards assumption, particularly at lower values of “gest.age.enroll” and “age”. Additionally, the clustering of residuals at lower values suggests that the linear relationship assumed in the model might not adequately capture the true relationship between these predictors and the outcome. Such findings highlight the need for further investigation, including transformations, time-dependent covariates, or stratified analyses to improve model fit and address assumption violations.
Overall, the residual analysis identified varying degrees of model fit and adherence to the proportional hazards assumption across the predictors. While “travel.minutes” demonstrated a good fit, other variables like “educ.year1”, “gest.age.enroll”, and “age” exhibited patterns warranting further exploration. To refine the Cox proportional hazards model, it is recommended to incorporate flexible modeling approaches such as splines or polynomial terms, test for time-dependent effects, and consider stratification where appropriate. By addressing these issues, the model can be improved to better reflect the underlying data structure and provide more reliable inferences in survival analysis.
3.4. Martingale Residual Diagnostics and Model Validity
To assess the adequacy of the functional form of the continuous covariates included in the Cox proportional hazards models, the Martingale residual plots were examined particularly for maternal age, years of education, “gest.age.enroll”, and travel time to the clinic. The plot for maternal age in
Figure 3 reveals a slight nonlinear (U-shaped) pattern, suggesting a mild departure from linearity in its association with the hazard of HIV infection or mortality. However, the deviations are modest and do not indicate severe model misfit. The residuals for education and travel time show no systematic patterns, supporting the adequacy of their linear specification. Given the relatively small number of events in the dataset, we opted for parsimony and model interpretability and did not apply transformations (e.g., splines or polynomial terms) or include time-varying covariates, as these may reduce statistical power or introduce overfitting. Nevertheless, we acknowledge that future studies with larger samples and more events may benefit from incorporating flexible modeling strategies such as restricted cubic splines or fractional polynomials to better capture potential nonlinearity. Overall, the Martingale residuals support the validity of the proportional hazards model and the appropriateness of the covariate specifications used in this study.
Figure 6, a histogram of the propensity score distribution by treatment arm, shows sufficient overlap (common support), confirming the appropriateness of the covariate adjustment method. The histogram and density plot in
Figure 6 shows the distribution of the estimated propensity scores for participants in the intervention and control arms. The observed overlap (common support) between the groups confirms the feasibility of covariate adjustment using propensity scores in the outcome models. Adequate overlap between groups indicates successful balancing of covariates, minimizing confounding bias.
Figure 7 displays the absolute standardized mean differences for all baseline covariates included in the propensity score model, comparing values before and after adjustment. A horizontal line at 0.1 indicates the conventional threshold for adequate balance. After adjustment, all covariates had SMDs < 0.1, indicating that balance was achieved between the intervention and control groups across key confounders.