Abstract
Background:
The prevalence of tuberculosis (TB) multi-drug resistance is increasing worldwide, including in Tanzania. This trend hinders the attainment of sustainable development goal number three as it increases the number of cases of the disease and treatment costs. Fewer cases of drug resistance have been reported over time, making it necessary to demand models that can handle an excessive number of zero counts. This study employed the zero-inflated Poisson (ZIP) models suitable for such data to assess drug resistance patterns.
Objective:
To examine the TB drug resistance spatiotemporal risk patterns and associated risk factors using health facility case notification data.
Design:
A retrospective cohort study utilizing TB drug resistance case notification data from the District Health Information System 2 for Tanzania Mainland between 2018 and 2020.
Methods:
The study was conducted in Tanzania Mainland and utilized TB drug resistance case data from 184 councils. Six hundred fifty-two (652) TB drug resistance cases were analyzed using the Bayesian ZIP spatiotemporal model to identify high-risk areas and risk factors for TB drug resistance. The deviance information criterion guided model selection.
Results:
The findings revealed a higher prevalence of drug resistance among males (65.2%), individuals aged 35–49 years (33.7%), persons living without HIV (66.4%) and new TB cases (70.7%). Spatiotemporal modelling indicated significant relationships between drug resistance and sex, age, TB treatment history and HIV status. Males were 1.4 times more likely to develop drug resistance than females. Children aged 0–4 and 5–14 years were 25 and 8.3 times less likely to develop drug resistance than adults aged 35–49. Persons living with HIV and those with unknown HIV status were 1.2 and 3.4 times less likely to develop drug resistance, respectively, than persons living without HIV. Individuals with a previous TB treatment history were three times more likely to develop drug resistance compared to new cases.
Conclusion:
The Bayesian ZIP spatiotemporal models provide critical insights by identifying high-risk populations and areas, enabling targeted interventions to control multi-drug resistant TB. The study further concludes that resistance to anti-TB drugs is highly associated with sex, age and previous treatment history. To mitigate its spread and impact, the study recommends strengthening awareness campaigns on adherence to treatment guidelines and understanding the risk factors associated with TB drug resistance.
Keywords
Introduction
Drug resistance is one of the problems that hinders the efforts to eradicate tuberculosis (TB) in the world. It is noted that mycobacterium tuberculosis is multi-drug resistant (MDR), indicating that they are resistant to at least one of the first-line anti-TB drugs, such as rifampicin and isoniazid. Multi-drug resistance is one of the causes of many deaths due to TB and an increase in the number of cases. 1 The study to estimate the burden of MDR-TB and extensive drug resistance tuberculosis (XDR-TB) in India, the Philippines, Russia and South Africa using mathematical models predicts an increase of TB incidents due to drug resistance from 2000 to 2040 in all countries despite all the efforts that are taken to overcome the problem. 2 The increase in MDR-TB is revealed as one of the obstacles toward achieving sustainable development goals. It is shown from the literature that the cost associated with the management of MDR-TB is relatively very high (six times higher compared to drug-sensitive TB) as its treatment regimen ranges from 9 to 20 months, and only one in three is diagnosed and treated. 3 The risk factors for drug resistance identified are the history of previous TB treatment and non-adherence to the treatment regimen. 4
Only 478 drug resistance cases in Tanzania were reported across all 184 councils from 2009 to 2015, indicating a low incidence rate. 5 This necessitates using models that can handle excessive zero counts, as most councils reported no cases during specific periods. The zero-inflated models are used for data with excessive zero-count observations, which are more common in rare events. The Poisson distribution is inappropriate for this kind of data, particularly when the observed number of zeros is greater than expected. To overcome this problem, the zero-inflated Poisson (ZIP) models are used to account for the zero observations that may originate from structural and sampling.6,7 The zero-inflated Poisson models without covariates were discussed by Refs. 8–10. Also, Heilbron 11 employed the “zero-altered” Poisson and negative binomial models to study the high-risk behaviour among gay men.
The full Bayesian analysis of zero-inflated Poisson regression models to identify significant covariates was also performed by Ghosh et al. 12 Moreover, the Bayesian ZIP spatial and spatiotemporal models have gained popularity in epidemiological studies involving uncommon diseases in particular areas, characterised by excessive zeros.6,13 –15 These models have been of great help in identifying the epidemiological patterns of the disease and its associated risk factors. Most of the studies to determine the prevalence and risk factors of anti-TB drug resistance in Tanzania have focused on providing the proportions of drug resistance cases and background characteristics of TB patients.16 –18 Most of these studies have not taken into account that drug resistance is an emerging health problem; thus, it is rarely prevalent. Consequently, there are limited studies establishing a clear relationship between drug resistance and the background characteristics of the patients. Therefore, this study employs a Bayesian ZIP spatiotemporal model to identify high-risk councils and key risk factors for TB drug resistance, leveraging health facility case notification data. These data were chosen for their reliability and capacity to provide real-time, case-based surveillance, which is essential for effective disease monitoring and response.
Materials and methods
Study design
This retrospective cohort study utilized data from TB patients diagnosed with TB drug resistance at various TB care and diagnostic centres across the Tanzania Mainland between 2018 and 2020. The study population consisted of all TB patients who sought medical assistance at the health facilities’ TB diagnosis and treatment section between 2018 and 2020. The study was conducted and reported in accordance with the Reporting of Studies Conducted Using Observational Routinely Collected Health Data (RECORD) Statement. 19
Setting
The study was conducted on Tanzania Mainland, which covers approximately 938,000 km2, of which water bodies occupy 60,000 km2. Its population is approximately 59,851,347, resulting in a population density of 68 people per square kilometre. 20 The country lies south of the equator between 1°–12° and 29°–41° East. The country shares borders with eight countries: Kenya and Uganda to the North; Rwanda, Burundi, the Democratic Republic of Congo and Zambia to the West; and Malawi and Mozambique to the South and the Indian Ocean to the East. The country is divided into 184 councils from 26 regions, with most of the population (65.6%) residing in rural areas. 20 The data were extracted from the District Health Management Information System 2 (DHIS2) of the Ministry of Health on 13th September 2022. The data included case notification data of all patients who attended the TB care and diagnostic centre from January 2018 to December 2020.
Participants
The study participants were all TB patients diagnosed with resistance to at least one of the first-line anti-TB drugs. The data were extracted from the Tanzania Ministry of Health’s DHIS2 and anonymized to ensure no personal identifiers were present.
Study variables
The variables involved in this study included the number of TB drug resistance cases notified over 3 years, from 2018 to 2020, which served as the outcome variable. The predictor variables included sex, age, treatment history and HIV status.
Data sources
This study utilized health facility routine drug resistance case notification data on tuberculosis, collected from all 184 councils across the 26 Tanzania Mainland regions, from 2018 to 2020. The case notification data were obtained from the National Tuberculosis and Leprosy Program (NTLP) and were accessed by the authors for this study on 23rd September 2022. The data consisted of information on all the TB patients who sought treatment and care from health facilities, particularly at the TB diagnosis and treatment centre, from all the health facilities that offer TB diagnosis and treatment. These facilities included public, private and faith-based organization health facilities.
Data analysis
The analysis was conducted using R software, 21 and the descriptive statistics are presented in tables. A Bayesian ZIP model adjusting for spatiotemporal random effects was used to model the spatiotemporal patterns of TB drug resistance risk patterns and their influencing factors. Also, the presence of spatial autocorrelation was assessed using Moran I. The deviance information criterion (DIC) was used to identify the best model by comparing models with spatial effects only, temporal effects only and the one incorporating spatiotemporal interactions.
Bayesian model specification
The drug resistance outcome to at least one TB treatment drug
where
When this model is used to model data with an excessive number of zeros, as in the case of this study, it suffers from the problem of instability with spatial random effects. Several models have been employed to model count data with excessive zeros. The most commonly used count data models include the zero-inflated negative binomial, Poisson, binomial, beta-binomial and hypergeometric distribution models.12
–15 In a zero-inflated model, zero observations are said to originate from structural and sampling effects. The number of drug resistance cases in the jth Council
and
This can be shown by the following probability mass function;
The structure of the zero-inflated model consists of the distribution at zero and an unstructured count distribution with a vector parameter
The main goal is to model µ
j
The spatiotemporal linear predictor of ZIP is specified as;
where
Model selection criteria using deviance information criterion
Several models can be considered in Bayesian spatiotemporal modelling, and many complex models can fit the given data well. The problem arises as to which model fits the given data well. The choice of the best model that fits the data well and can easily be computed and interpreted is of great interest. Several model selection criteria have been specified, including the Akaike information criterion (AIC), Bayesian information criterion (BIC), DIC and the Watanabe information criterion (WAIC). This study has employed the DIC, an extension of the AIC, in selecting the best model, as the DIC is more suitable for providing theoretical justification in selecting complex hierarchical Bayesian spatial models, as it balances model fit and complexity. In addition, this study considered the spatial aspects of the analysis. The DIC was deemed appropriate for model selection, as other criteria, such as WAIC, would have been computationally expensive. Meanwhile, BIC can over-penalize model complexity, potentially leading to underfitting. 23 According to Spiegelhalter et al., 24 DIC is defined as the difference between the posterior mean of the deviance and the deviance at the posterior means of the parameters of interest.
The DIC is defined as:
where
Therefore, based on the DIC, the best model to be selected and considered adequately fitting the data is the one with the lowest value of the DIC score.
Disease standardized incidence ratio
Disease standardized incidence ratio (SIR) refers to the ratio of observed and expected cases. The SIR is used to estimate the occurrence of an event in a given population based on what might be expected, provided that the population under consideration has a similar experience as the general population. 25 In this study, the SIR was utilized to analyze patterns of drug resistance in TB by comparing the number of observed drug-resistant TB cases to the expected number based on reference population data. This approach allowed for the identification of disparities in drug resistance patterns. It provided a foundation for generating hypotheses and directing further modelling efforts to identify the factors influencing TB drug resistance. The SIR is computed using the formula in Equation (10) and results presented on the spatial maps to report areas with high risk of the disease:
The findings are interpreted based on the value of SIR, where a value greater than one indicates a higher risk in that area, and a value below one indicates a lower risk.
Moran’s I test for spatial autocorrelation
The spatial autocorrelation of TB-HIV coinfections among Councils was determined using the Global Moran Index (I). This was done assuming that Z
i
and Z
j
as the observed counts of TB-HIV co-infection cases in Councils C
i
and C
j
where
where
Note:
Results
Distribution of drug resistance cases across background characteristics
Drug resistance to anti-TB medications was much more prevalent among male individuals, constituting 65.2% of the total cases. According to the findings, this trend continued year after year, with 59.4% of drug-resistant cases reported in 2018, rising to 67.2% in 2019 and 68.3% in 2020. This suggests that there is a statistically significant gender difference (p = 0.012) in anti-TB drug resistance cases across years, as men consistently make up the majority of drug resistance cases across all studied years. Thus, targeted awareness campaigns among males on adherence to treatment guidelines and understanding of TB drug resistance risk factors, such as smoking and alcohol use27 –29, should be strengthened, including scaling up of directly observed treatments (Table 1).
Distribution of drug resistance cases by background characteristics of the patients.
Source: Author’s calculations from Tanzania Mainland 2018–2020 TB data.*Significant at 5% level.
The analysis reveals a significant difference (p-value < 0.001) in the average number of cases reported across years by age, indicating that drug resistance was most prevalent in patients aged 35–49 years, with 33.7% of cases occurring in this age group. Furthermore, around 60% of all reported cases in 2018, 2019 and 2020 were among patients aged 35 and older. Specifically, the highest percentages of drug resistance in the 35–49 age group were reported in 2018 (33.5%), 43.3% in 2019 and 37.0% in 2020. In contrast, the lowest rates of drug resistance were reported in children aged 0–4 years, who represented only 1.0%, 0.8% and 0.5% of cases in 2018, 2019 and 2020, respectively. These results suggest that drug resistance is more prevalent in older age groups, with an increase in resistant cases associated with advancing age. As individuals aged 35–49 are of working age, studies indicate that occupation is among the factors contributing to non-adherence to the treatment regimen. 27 Thus, workplace awareness campaigns should be conducted (Table 1).
In terms of HIV status, there was a significant difference (p-value < 0.001), with the majority of drug resistance cases reported among individuals who tested HIV-negative, making up 61.9%, 66.4% and 70.7% of all reported cases in the years 2018, 2019 and 2020, respectively. Conversely, drug resistance cases were less common among persons living with HIV and those whose HIV status was unknown. This indicates a notable trend where persons living without HIV seem to carry a heavier burden of TB drug resistance, which could be indicative of various biological, social, or healthcare-related influences (Table 1).
The treatment history of TB also highlighted significant disparities (p = 0.019) whereby individuals with no previous treatment history (new cases), a total of 70.7% of reported cases, were drug-resistant, with annual rates of 65.5% in 2018, 71.3% in 2019 and 74.5% in 2020. Conversely, patients who had previously undergone TB treatment accounted for 29.3% of the drug-resistant cases overall, with annual rates of 34.5% in 2018, 28.7% in 2019 and 25.5% in 2020. These results indicate that drug resistance is more common in new cases, underscoring the necessity for careful monitoring of first-line treatments and prompt interventions to avert the emergence of resistance (Table 1).
Disease resistance cases in Tanzania Mainland from 2018 to 2020
Generally, the findings in Figure 1 indicate a low incidence of drug resistance across all study years (2018, 2019 and 2020). Moreover, the results reveal many outliers in all the years, though in 2019, there was a pronounced outlier of above 30 TB drug resistance cases (Supplemental Material).

Box plot of TB drug resistance cases from 2018 to 2020.
Drug resistance standardized incidence ratio across councils
The findings revealed that most councils in Tanzania Mainland have a low incidence ratio of less than one. Moreover, the results indicate an increase in the SIR from 2018 to 2020, as the number of Councils at risk of drug resistance has also increased from 2018 to 2019 (Figure 2).

Map showing drug resistance standardized incidence ratio across councils.
Moran’s I test for spatial autocorrelation
The findings indicate a significant positive spatial autocorrelation, indicating that neighbourhood Councils have similar risks of tuberculosis drug resistance (Table 2).
Moran I test for spatial autocorrelation.
Adjacency matrix showing the pattern in the neighbourhood structure of the Tanzania Mainland Councils
The findings in Figure 3 indicate that some councils are isolated, while others are centrally located.

Adjacency matrix of Mainland Tanzania Councils.
Model comparison of zero-inflated Poisson regression models
This study considered four Poisson regression models in modelling the risk of resistance to antimicrobial drugs. These models included non-spatial, temporal, spatial and spatiotemporal models, adjusting for spatiotemporal random effects. All these models were compared and evaluated using DIC. The findings indicate that the ZIP spatiotemporal model fits the data best, as it has the lowest DIC value of 3923.24, compared to other models. This spatiotemporal model facilitates a deeper understanding of drug resistance patterns by identifying areas with persistently high or emerging risks over time. This is important for designing targeted interventions, guiding resource allocation and formulating effective policy measures. Moreover, integrating spatial and temporal components provides a comprehensive understanding of TB drug resistance risk dynamics across councils, capturing geographic differences and temporal trends vital for addressing this emerging public health challenge.
The ZIP spatiotemporal model was used to investigate the presence of zero inflation and temporal and spatial autocorrelation. Zero inflation was tested under the null hypothesis that there is no zero inflation. The results indicated a significant presence of zero inflation of 0.29 (0.20, 0.40) at a 95% significance level.
In addition, the presence of a temporal trend was tested using the coefficient of the first-order autocorrelation model, with the null hypothesis that the process was not stationary. The findings revealed a significant presence of stationarity. Moreover, the presence of spatial autocorrelation was tested using Moran’s I index under the null hypothesis that there was no spatial autocorrelation. The results indicate spatial autocorrelation, with a p-value of less than 0.001.
The ZIP spatiotemporal findings indicate a significant relationship at a 5% level of significance between drug resistance and sex, age, history of TB treatment and HIV status of the patients. The findings reveal that males are 1.4 times more likely to develop TB drug resistance than female patients. Regarding the age of the patients, children aged 0–4 and 5–14 years are 1/0.04 = 25 and 1/0.12 = 8.3 times less likely to develop TB drug resistance, respectively, compared to adults aged 35–49 years. Also, youth aged 15–24 years are 1/0.58 = 1.7 times less likely to develop TB drug resistance compared to adults aged 35–49 years. Moreover, elders aged 25–34 and 50 years and above are 1/0.76 = 1.3 and 1/0.64 = 1.6 times less likely to develop TB drug resistance compared to adults aged 35–49 years, respectively. On the relationship between TB drug resistance and the HIV status of an individual, the results reveal that those living with HIV and those with unknown HIV status are 1/0.84 = 1.2 and 1/0.29 = 3.4 times, respectively, less likely to develop drug resistance compared to those who are living without HIV. Furthermore, individuals with previous TB treatment history were at higher risk (Relative Risk (RR) = 3.05) compared to those without previous TB treatment history (Table 3).
Univariate and zero-inflated Poisson models adjusting for spatiotemporal random effects.
Significant at 5% level.
Posterior density plots for fixed effects
The convergence of parameter estimates was fitted using the logarithmic form of the posterior density plot of the fixed effects. The posterior mean density plots of the ZIP spatiotemporal model in Figure 4 indicate that the parameter fitted well as Gauss–Markov Random Field (GRMF) since all the plots were symmetrical, indicating that the mean, median and mode are equal.

Posterior density plots for the fixed effects of the ZIP spatiotemporal model.
Plot of posterior mean, median and 95% credible interval over time
The findings of the analysis indicate that there was no significant temporal trend of TB drug resistance across the councils from 2018 to 2020 (Figure 5).

Plot of posterior mean, median and 95% credible interval over time.
Tuberculosis drug resistance relative risks across councils
The findings in Figure 6 indicate a dynamic pattern in TB drug resistance across the Councils in the Tanzania Mainland. The highest risk to most councils was observed in 2019, followed by 2020. According to findings from 2018, the Councils in the southern regions, around Lake Victoria, Dar es Salaam and the south-western part of the country were at a higher risk of TB resistance than other areas. In 2019, councils around Lake Victoria, particularly in the northern and western parts, and a few Councils in the southern part of the country, were at higher risk. Moreover, in 2020, Councils around the central, Dar es Salaam and the south-western parts of the country were at a higher risk than others.

TB drug resistance relative risk quartiles.
Discussion
The descriptive findings of this study indicate that a high proportion of individuals who were resistant to antimicrobial drugs were among males (65.2%), aged 35–49 years (33.7%), persons living without HIV (66.4%) and new cases (70.7%). The results agree with those of Refs. 29–32 where they obtained the same results as this study, with the highest proportion of drug resistance being high among males, living without HIV, elderly individuals aged 35–49 years and new cases. The standardized incidence rates reveal some space-time dynamics of TB risk across Councils, with high risk observed in 2020. In addition, spatiotemporal relative risk quartile findings indicate some heterogeneity in disease risk across Councils with space and time dynamics. These findings are similar to those reported by Faustini et al., 30 who concluded that there is a significant association between geographical location and MDR-TB resistance. Therefore, fighting against TB drug resistance should consider the heterogeneity of disease risks across geographical locations (Councils), and interventions should focus on high-risk areas. 31
Moreover, the zero-inflated spatiotemporal Poisson regression model adjusting for spatiotemporal random effects to assess the risk factors for TB drug resistance indicates that the risk is high among male patients (RR = 1.37), aged 35–49 years, compared to other age categories, persons living without HIV, patients with previous TB treatment history (RR = 3.05). These findings are similar to those of other studies that assessed the risk factors for anti-tuberculosis drug resistance, where they observed that male and previously treated individuals with tuberculosis were at higher risk of drug resistance than females and new TB cases, respectively.30,32 It can be observed that, similar to this study, a history of previous TB treatment was the most common significant risk factor among all the studied factors that need to be addressed when fighting against TB drug resistance29–35 though few studies have concluded that patients with previous TB treatment history had low risk. 36 The high risk of TB drug resistance among males may be attributed to their involvement in TB risk factors such as smoking, alcohol consumption and occupational hazards like mining and quarrying, which may increase the vulnerability and complications in treatment.27 –29 Due to their obligations, male individuals are more likely to have less frequent contact with health care services, which in turn may lead to delayed diagnosis and obtaining appropriate treatment. Also, they are prone to non-adherence to treatment regimens, which increases the risk of drug resistance. Individuals aged between 35 and 49 years are at higher risk of drug resistance, as this is the working age, which may increase the exposure to TB risk factors, including high density in working places, delayed diagnosis and interruptions in TB treatments. Also, this age is prone to comorbidities such as diabetes, which can cause complications in TB treatment. 37 Thus, public health initiatives focusing on enhancing timely TB diagnosis, thoroughly monitoring TB patients and adherence to recommended TB treatment guidelines must be strengthened.31,34,38 In addition, increasing health education campaigns regarding the TB drug resistance risk factors, including smoking, diabetes and alcohol use, should be prioritized for men and those aged 35 to 49 years.
On the other hand, different results were obtained in assessing the association between the risk of anti-TB drugs and the sex of the patients, where it was seen that there was an insignificant relationship between the two. 28 Also, this study concludes a higher risk of drug resistance among persons living without HIV compared to those living with HIV, which is different from other studies that concluded a significantly high risk among those living with HIV.30,31,35
Study limitations
Due to limited resources, this study relied solely on available health facility case notification data, resulting in a small sample size of 652 cases of drug resistance. As a result, the sample size was not computed. Despite the availability of fewer cases, the study utilized ZIP models that provide reliable estimates when there are fewer cases and an excessive number of zeros in some areas at particular periods.6,13,15
Conclusion
The findings acknowledge the presence of resistance to the TB treatment regimen. It is concluded from the study findings that there is a risk of drug resistance, which is geographically distributed across different Councils with some space-time dynamics. The study further concludes that resistance to anti-TB drugs is highly attributed to the sex of the patients, whereas male TB patients were prone to drug resistance compared to female patients. Also, adult patients aged 35–49 years were at higher risk than those aged below 35 and above 49 years. Patients with previous TB treatment history were at higher risk compared to newly diagnosed patients. Furthermore, HIV infection was not found to be among the risk factors for drug resistance, as persons living with HIV were found to have a lower risk compared to those without HIV. The study recommends geographically focused interventions that consider the spatiotemporal factors influencing the risk of TB drug resistance. This can be accomplished by incorporating spatiotemporal models into the national TB surveillance system, enabling timely detection of emerging TB drug resistance hotspots, facilitating data-driven public health interventions and effectively allocating limited resources. In addition, strengthening awareness campaigns on the significance of full adherence to treatment regimens and understanding TB drug resistance risk factors are highly required.
Supplemental Material
sj-docx-1-tai-10.1177_20499361251339576 – Supplemental material for Spatiotemporal analysis of tuberculosis drug resistance and associated risk factors in Tanzania
Supplemental material, sj-docx-1-tai-10.1177_20499361251339576 for Spatiotemporal analysis of tuberculosis drug resistance and associated risk factors in Tanzania by Bwire Wilson Bwire, Maurice C. Y. Mbago and Amina S. Msengwa in Therapeutic Advances in Infectious Disease
Footnotes
Acknowledgements
The authors express their sincere gratitude to the University of Dar es Salaam for their support and ethical approval for conducting this study. We would also like to convey our appreciation to the Ministry of Health for providing permission to access the data through the National Tuberculosis and Leprosy Program (NTLP). Lastly, we appreciate the NTLP for unconditionally providing the TB surveillance case notification data.
Declarations
Supplemental material
Supplemental material for this article is available online.
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
