Bayesian Epidemiologic

Screening Techniques



Obtaining the specific Beta prior distributions for Se, Sp and Prevalence with BetaBuster


BetaBuster is a GUI that was designed by Dr. Chun-Lung Su for the purpose of obtaining specific Beta prior distributions based on scientific input for quantities like the sensitivity or specificity of a diagnostic test or prevalence. For example, assume that a scientist is asked for their best guess for the Se of a particular test and the answer is 0.9. Moreover, if the scientist is also willing to assert that he/she is 95% sure that the Se is greater than 0.75, BetaBuster will take this information and obtain the unique Beta distribution that has mode (value with the greatest density/plausibility) equal to 0.9 and which has 95% of the area to the right. In fact, the Beta(22.99, 3.44) distribution is obtained by BetaBuster, and is also plotted in the process. This is accomplished by putting in the above input information and then clicking on "Set Priors".




In addition, it is possible to use BetaBuster to specify the two parameters of the Beta(a, b) distribution, and to obtain a plot of that distribution. This is accomplished by first double clicking on the word "Density", and they typing in a and b and clicking on "Set Priors".





Download BetaBuster


UC Legal Disclaimer - The Regents of the University of California disclaim all warranties with regard to these software, including all implied warranties of merchantability, non-infringement, and fitness for a particular use. In no event shall the Regents of the University of California be liable for any direct, special, indirect, or consequential damage or any damage whatsoever resulting from the loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of these software. Use at your own risk. If you do not agree to this, do not use these software.



Click here to download BetaBuster 



Note: Please use "English (United States) - US" as your Input Language when using BetaBuster. BetaBuster does not accept comma instead of dot as decimal separator. 



Expanded Description


Beta distributions can be used to model binomial probabilities (e.g. prevalence and test accuracy values) in a Bayesian analysis. The Beta distribution is characterized by 2 shape parameters, often designated as a and b, that can be manipulated to change the shape of distribution, e.g. make it more or less peaked, or change the location of its most likely value.


(1) What types of shapes are possible for Beta distributions?


The values given to the parameters, a and b, determine the final shape of the distribution. There are 5 common scenarios that users mostly will be interested in:



a > 1 and b > 1, unimodal distributions are obtained.




a = 1 and b = 1, a “flat” prior is obtained. This is equivalent to a Uniform(0, 1) distribution.




a < 1 and b < 1, the distribution is bimodal with modes at 0 and 1.




a = 1 and b > 1, the mode is 0 with high values being unlikely.




a > 1 and b = 1, the mode is 1 with low values being unlikely.



It is also possible to have 2 other scenarios; a = 1 and b < 1, and a < 1 and b = 1.



(2) How are the mean, mode and variance calculated for a beta distribution?


Mean = a / (a + b)

Mode = (a - 1) / (a + b - 2)

Variance = ab / [(a + b + 1)(a + b)^2]



(3) How do I construct an appropriate beta prior distribution when I don't know a and b?


Two approaches are possible. The first is based on expert opinion and the second uses data from comparable experiments. BetaBuster was primarily designed to address the first situation and allow easy implementation by users without access to specialized software such as S-plus. The program allows calculation of Beta distributions for scenarios 1, 2, 4 and 5 that are described above. In the second situation, the parameters of the distribution can be directly calculated from the observed data as described in a subsequent section. For this situation, it is possible to draw the corresponding Beta density with BetaBuster using the calculated values of a and b.



(4) What information do I need from an expert to allow me to use BetaBuster?


Two inputs are necessary before using the program. The expert should initially be asked for the most likely value of the parameter of interest – this is set to the mode of the corresponding Beta prior.


If the modal value is between 0 and 0.5, ask the expert for the 95th percentile of possible values for the parameter (e.g. you are 95% certain that the parameter is below what value?)


If the modal value is between 0.5 and 1, ask the expert for the 5th percentile of possible values for the parameter (e.g. you are 95% certain that the parameter exceeds what value?)


If the modal value is designated by the expert to be 0.5, then ask for either the 5th or 95th percentile since the distribution is symmetric.



Example: Suppose an expert indicates that the most likely value for the sensitivity of an ELISA test is 0.9 and he is 95% sure that the value exceeds 0.7.


Step 1: Enter the values of 0.7 and 0.9 into the top line of the screen either by typing in the values or using the spindles to toggle to the appropriate numbers. The data entry line should indicate that the expert is “95% sure that x greater than 0.7 and Mode at 0.9”. Values cannot be entered in the other blank spaces elsewhere on the screen – blank spaces are for values generated by the program.


Step 2: Click on the “Set Priors” button and the appropriate beta distribution is generated: a = 15.0342 and b = 2.5594 with mean, variance and the 2.5th and 97.5th percentiles. Should you wish percentiles other than the 2.5th and 97.5th percentiles, you can double click on the corresponding label e.g. “2.5%” and adjust it to say 5%. The percentile is automatically adjusted.



The corresponding Beta density is generated in the graph window and this can be verified as appropriate by the expert. If it is considered inappropriate, the limits and mode can be adjusted until they generate a picture that is suitable and correctly represents scientific input.



(5) How do I obtain a Beta distribution using data from a prior study?


Suppose a previous comparable and well-designed study involved the testing of 100 infected animals and 90 animals tested positive and 10 animals tested negative. Then a Beta(91, 11) distribution as shown in the figure above would be appropriate for modeling uncertainty about test sensitivity provided the animals tested are similar in both studies.


In general, if an experiment resulted in “s” successes (e.g. no. test-positive animals) recorded in “n” trials (e.g. number of truly infected animals), use of a Beta(a, b) distribution with a = s + 1 and b = n - s + 1 is an appropriate choice to model the uncertainty in that parameter.



(6) Can I draw a beta density and obtain means, medians and percentiles that correspond to known values of a and b?


Yes, double click on the label “Density” on the left hand side of the input window. The font color will change from Black to Bold Red. Input the known values for a and b and click on the “Set Priors” button. Double clicking on the “Density” label will return the original setting.



(7) How can I obtain a copy of the beta distribution in the figure window?


In the directory in which you installed the program, there is a bitmap file, "betabuster.bmp", that is automatically updated when you click on the “Set Priors” button. The file is overwritten with each new Beta distribution that you create so that it only contains the figure from the current calculation.


A second option is to do a screen capture (with the Print Screen key) and paste the screen into a program such as Microsoft Paint. The editing tool can then be used to select the part that you wish to keep, e.g. the Beta density only or the entire BetaBuster GUI that includes a and b values, mean, variance, median and percentiles.