Predictive modelling of risk factors associated with HIV infection amongst adults in South Africa in 2016 using supervised machine learning
Loading...
Date
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
University of the Witwatersrand, Johannesburg
Abstract
Background HIV incidence has been declining globally but it remains high in Sub Saharan Africa where 60% of cases in the world originate, with South Africa alone contributing 19% of global HIV population. In this era of artificial intelligence, predicting individuals at risk of HIV is vital for targeted prevention, early intervention and ultimately reducing HIV mortality. We identified the risk factors associated with HIV infection among adults in South Africa in 2016. Method A secondary data analysis was conducted using cross sectional data from the DHS 2016 survey, which included 2726 women and 2136 men in South Africa, to identify risk factors associated with HIV infection. One variable was removed whenever the correlation was >80%. Lasso regression and generalized variance selection were used to identify the best predictors of HIV infection. Systematic descriptive analysis was first conducted. This was followed by sex stratified multilevel logistic regression to control for confounding. Missing data was handled using multiple imputations. Risk factors were then ranked based on model coefficients, and a risk scoring tool was developed. Finally, the stratum specific predictive performance of the models was compared using F1 scores on the test data. Results HIV prevalence was 28.7% in females and 14.9% in males. Common risk factors associated with higher odds of infection in both sexes included older age (females AOR: 2.49; 95% CI: 1.42– 4.38; males AOR: 6.72; 95% CI: 3.39–13.33) and condom use during the last sexual encounter (females AOR: 2.11; 95% CI: 1.54–2.89; males AOR: 2.76; 95% CI: 1.26–6.05). Protective factors included male circumcision (AOR: 0.48; 95% CI: 0.32–0.71). For females, XGB model performed best (F1: 0.82 weighted, 0.77 balanced, 0.72 unweighted data). For males, XGB led on weighted (0.92) and balanced (0.83) data; logistic regression was best on unweighted (0.80). Conclusion vi HIV prevalence was twice as much in females compared to males. Of note is highest prevalence among black women and men, residing in the KwaZulu-Natal (KZN) region. Teen girls also have a higher rate of HIV infection than teen boys. Additionally, women and men who used a condom during their last sexual encounter were more likely to be infected. Circumcision was protective amongst men. XGB was the model with the best predictive performance. Public health efforts should prioritize targeted HIV prevention and treatment strategies for high-burden groups, including Black women and men in KwaZulu-Natal and adolescent girls. Expanding access to youth-centered sexual health education, promoting consistent condom use, and scaling up male circumcision programs could significantly reduce HIV transmission. XGB highlights the potential of machine learning tools to support targeted HIV interventions by early identification of high-risk people.
Description
A research report submitted in fulfillment of the requirements for the Master of Science , in the Faculty of Health Sciences, School of Public Health, University of the Witwatersrand, Johannesburg, 2025
Keywords
Citation
Nyahuma, Munyaradzi . (2025). Predictive modelling of risk factors associated with HIV infection amongst adults in South Africa in 2016 using supervised machine learning [Master’s dissertation, University of the Witwatersrand, Johannesburg]. WIReDSpace. https://hdl.handle.net/10539/49766