bootComb—an R package to derive confidence intervals for combinations of independent parameter estimates

Abstract Motivation To address the limits of facility- or study-based estimates, multiple independent parameter estimates may need to be combined. Specific examples include (i) adjusting an incidence rate for healthcare utilisation, (ii) deriving a disease prevalence from a conditional prevalence and the prevalence of the underlying condition, (iii) adjusting a seroprevalence for test sensitivity and specificity. Calculating combined parameter estimates is generally straightforward, but deriving corresponding confidence intervals often is not. bootComb is an R package using parametric bootstrap sampling to derive such intervals. Implementation bootComb is a package for the statistical computation environment R. General features Apart from a function returning confidence intervals for parameters combined from several independent estimates, bootComb provides auxiliary functions for 6 common distributions (beta, normal, exponential, gamma, Poisson and negative binomial) to derive best-fit distributions for parameters given their reported confidence intervals. Availability bootComb is available from the Comprehensive R Archive Network (https://CRAN.R-project.org/package=bootComb).


Motivation
In epidemiological research, the need to combine several estimated parameters is not unusual. The impact of study or facility-based limitations on parameter estimates is well-known 1 and common adjustment factors include the probability of seeking healthcare or of receiving a diagnostic test (both in the case of facility-based estimates), the incidence or prevalence of a related condition (in the case of a conditional disease prevalence/incidence), or the operational characteristics of the diagnostic test (in the case of imperfect diagnostic tests). A recent example includes the estimation of typhoid incidence 1 where a Bayesian model was used to derive adjustment factors. While usually easy to combine point estimates, it is often difficult to obtain a valid confidence interval (CI) for the combined parameter.
The development of bootComb was motivated by two real-world examples: i. Obtaining a 95% CI for hepatitis D virus (HDV) prevalence from the reported estimates and 95% CIs for the conditional prevalence of hepatitis D among hepatitis B surface antigen (HBsAg) positive patients and the prevalence of HBsAg. 2 ii. Adjusting the seroprevalence estimate obtained from a novel antibody test for SARS-CoV-2 for the estimated sensitivity and specificity of this test. 3 In both applications, the parameter of interest was the unconditional (HDV example) or the adjusted (SARS-CoV-2 example) prevalence, not the raw, directly measured estimate and in each case, multiple independently estimated parameters had to be combined via a known mathematical function. However, it was not evident how to derive a corresponding CI.
In public health applications, CIs are as important for policy makers than the central point estimates. CIs are needed for the adjusted incidence or prevalence parameters, not for the raw, unadjusted estimates. Given recent guidelines 4 for nuanced discussion of the full range of values within estimated CIs rather than just a focus on point estimates and p-values, there is a large need for CIs with correct coverage and this is where bootComb provides a simple-to-use tool to propagate uncertainty from all estimates.
While in both examples above all parameters are probability parameters, the algorithm is general: it can be used for arbitrarily complex functions to combine an arbitrary number of parameters, each with an arbitrary distribution (provided it can be sampled from).

Context relative to previously existing software
For some situations, e.g. the sum of two normally distributed, exact solutions exist. There are software implementations for the example of adjusting a prevalence estimate for the sensitivity and specificity of the diagnostic test (e.g. Reiczigel et al 5 , or https://larremorelab.github.io/ covid-calculator26). The former of these assumes that sensitivity and specificity are known exactly. For specific applications, a Bayesian model 6 or non-parametric bootstrapping 7 will propagate uncertainty from all parameters but implementation of such approaches requires substantial statistical programming expertise.
Crucially, all of the above are for specific applications and the author is not aware of a software implementation for the general problem of deriving CIs for arbitrary functions of an arbitrary number of parameter estimates each with an arbitrary probability distribution. Implementation bootComb is a package for the statistical computation environment R 8 and its source code is written in R. bootComb is available from the Comprehensive R Archive Network (https://CRAN.R-project.org/package¼bootComb) and can be installed within R by typing the following at the R console: install.packages('bootComb'). Source code and the latest development version are available from GitHub (https://github.com/gitMarcH/bootComb). To compute highest density intervals bootComb makes use of the R package HDInterval 9 . If this is not installed, bootComb falls back on the percentile method.
An estimate for / is obtained by computinĝ / ¼ gĥ 1 ; . . . ;ĥ k À Á , but it is less obvious how to derive a CI for/ with correct coverage ð1 À aÞ Á 100%. For example, for independent parameter estimates, the naively computed

Key Features
• bootComb derives confidence intervals with the required coverage for parameters that are computed from independent parameter estimates for which confidence intervals are reported.
• Includes auxilliary functions for 6 common distributions (beta, normal, exponential, gamma, Poisson and negative binomial) to derive best-fit distributions (and their sampling functions) for parameters given their reported confidence intervals.
Writing H j for the estimator for h j , and assuming H j $ F j , where F j is some parametric distribution, for each parameter estimateĥ j ; j ¼ 1; . . . ; k, we can estimate a probability distributionF j from the reported CI ½ĥ l;j ;ĥ u;j and then use parametric bootstrap sampling to obtain an approximate CI for/ with the required coverage.
The general algorithm is given below: i. For j ¼ 1; . . . ; k, estimate a distribution functionF j for the estimate H j from ½ĥ l;j ;ĥ u;j . ii. Assuming that the parameters h 1 ; . . . ; h k (and their esti- iv. Obtain a ð1 À aÞ Á 100% CI ½/ l ;/ u , using either the percentile 9 or the highest density interval 10 methods on the empirical distribution for/ given by the sample/

Method for deriving CIs from a sample
As an alternative to the common percentile method 10 , the highest density interval (HDI) 11 can be used to derive the required CI. The advantage is that this is the narrowest interval with the desired coverage and that the probability density estimated from the bootstrap sample is always higher or equal inside the interval compared to outside it. One caveat is that the HDI may not be a single interval but a set of intervals if the density is multimodal. In this case the single interval returned by bootComb may be too wide and users need to inspect histograms of the sampled combined parameter to check for multimodality when using bootComb with method¼'hdi'. The default is method¼'quantile' which implements the percentile method.

Use
This section contains worked examples for the two applications from the Introduction section. The main computational routine, bootComb(), is general and not limited to probability parameters as is the case here where the beta distribution, a natural candidate for probability parameters, was used.

Hepatitis D virus prevalence in the general population
A pre-condition for hepatitis D virus (HDV) infection is hepatitis B virus (HBV) infection. To assess HBV prevalence, study participants can be tested for the presence of surface antigen of the hepatitis B virus (HBsAg). To assess HDV prevalence, one can test for the presence HDVspecific immunoglobulin G antibodies (anti-HDV). HDV is rare and, since it is conditional on HBV, most studies report the prevalence of anti-HDV among HBsAg-positive patients. Stockdale et al 2 conducted a systematic review to estimate the global conditional prevalencep aHDVjHBsAg and, using estimates of HBsAg prevalencep HBsAg reported by the World Health Organization (WHO), to derivep aHDV : p aHDV ¼p aHDVjHBsAg Áp HBsAg . The CI forp aHDV for the global population, reported in Table 2
The immunological assay used in the study was novel and had been assessed in a limited number of samples as follows 3 Given that the test has sensitivity and specificity below 100%, and the substantial uncertainty of both estimates, it is important to adjust seroprevalences estimated using this test. This is a common situation, e.g. molecular tests are increasingly developed to replace culture-based assays.
Writing p sens ¼ PðTjDÞ and p spec ¼ PðT jDÞ where T is the event of testing positive, D is the event of being seropositive, and T ; D are the complements of T; D, the measured seroprevalencep raw is related to the estimate of the actual seroprevalencep: p raw ¼p Á PðTjDÞ þ ð1 ÀpÞ Á PðTjDÞ We can derive an equation to adjust the measured seroprevalence for the assay's sensitivity and specificity: p ¼p raw À PðTjDÞ PðTjDÞ À PðTjDÞ ¼p raw þp spec À 1 p sens þp spec À 1 where we have substituted the estimated sensitivity and specificity in the expression on the right-hand side.

Discussion
This paper presents bootComb, an R package to derive CIs for arbitrary functions of an arbitrary number of estimated parameters, where each parameter estimate follows an arbitrary distribution function. bootComb samples from the empirical distributions of the input parameter estimates and uses either the percentile or high density interval (HDI) method to obtain a CI for the parameter of interest.
The applicability of this R package is wide but has one important limitation: in its current version, bootComb assumes all parameter estimates to be independent. Where this is not the case, the CIs computed by bootComb could have incorrect coverage. In the adjusted seroprevalence example, the three parameters are not independent, even though they were estimated from independent samples. This is apparent in a small number of adjusted prevalenceŝ p < 0 that were obtained. In most applications, especially for large sample sizes, this error is negligible; in the seroprevalence example this is confirmed by the correct coverage of the CI. In cases where independence is not met, bootComb will err on the side of being too conservative, resulting in overly wide CIs. This is preferable to not correctly propagating uncertainty and reporting CIs with coverage below the targeted level. For many, if not most, situations, the independence assumption will hold (when parameters are obtained from independent studies without direct dependence between the combined parameters) or its violation will only negligibly affect the coverage of the resulting CIs (as in the adjusted seroprevalence example). Nevertheless, future versions of the package will aim to support a limited number of joint distributions. For more complicated dependence situations, custom modelling approaches will be needed.
bootComb provides an easy-to-use tool to the applied epidemiologist faced with the need to combine several independent parameter estimates.

Data availability
The data underlying this article are available in the article.