Description Usage Arguments References Examples

A function to estimate the parameters alpha and beta of a Beta distribution based on the existing prior beliefs (data and/or expert opinion). Information is provided about the mean (or the median or the mode) and whether it is lower or greater that a certain value with a pre-specified certainty (usually set at 95%).

1 2 |

`themean` |
specify your prior beleif about the mean. It takes a value between 0 and 1. Not to be specified if a value has been given for the median or the mode. |

`themedian` |
specify your prior beleif about the median. It takes a value between 0 and 1. Not to be specified if a value has been given for the mean or the mode. |

`themode` |
specify your prior beleif about the mode. It takes a value between 0 and 1. Not to be specified if a value has been given for the mean or the median. |

`percentile` |
specify the level of confidence that the true value of the mean (or the median or the mode) is greater or lower than the percentile.value. It takes a value between 0 and 1 and the default =0.95. |

`lower.v` |
logical, if TRUE the specified percentile.value is the upper limit for the mean (or the median or the mode) at the specified confidence level (percentile). If FALSE the specified percentile.value is the lower limit for the mean (or the median or the mode) at the specified confidence level (percentile). The default is FALSE. |

`percentile.value` |
specify the upper or lower limit for the mean (or the median or the mode) at the specified level of confidence (percentile). It takes a value between 0 and 1. |

Branscum, A. J., Gardner, I. A., & Johnson, W. O. (2005): Estimation of diagnostic test sensitivity and specificity through Bayesian modeling. Preventive veterinary medicine, **68**, 145–163.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | ```
##Example 1
##Based on the available literature the mean value for the sensitivity of a test
##is expected to be 0.90 and we can be 95% sure that it is higher than 0.80.
findbeta(themean=0.90, percentile=0.95,lower.v=FALSE, percentile.value=0.80)
## The output is:
##[1] "The desired Beta distribution that satisfies the specified conditions is:
##Beta( 27.79 3.09 )"
##[1] "Here is a plot of the specified distribution."
##[1] "Descriptive statistics for this distribution are:"
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.6192 0.8688 0.9077 0.8996 0.9391 0.9974
##[1] "Verification: The percentile value 0.8 corresponds to the 0.05th
##percentile
##Example 2
##Based on the available literature the median value for the specificity of a
##test is expected to be 0.99 and we can be 95% sure that it is higher than
##0.90.
findbeta(themedian=0.99, percentile=0.95,lower.v=FALSE, percentile.value=0.90)
## The output is:
##[1] "The desired Beta distribution that satisfies the specified conditions is:
##Beta( 18.97 0.52 )"
##[1] "Here is a plot of the specified distribution."
##[1] "Descriptive statistics for this distribution are:"
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.5634 0.9637 0.9871 0.9735 0.9970 1.0000
##[1] "Verification: The percentile value 0.9 corresponds to the 0.05th
##percentile"
##Example 3
##The most probable value (mode) for the prevalence of a disease/infection in a
##population is expected to be 0.15 and we are 90% sure that it is less that
##0.40.
findbeta(themode=0.15, percentile=0.90,lower.v=TRUE, percentile.value=0.40)
## The output is:
##[1] "The desired Beta distribution that satisfies the specified conditions is:
##Beta( 2.15 7.52 )"
##[1] "Here is a plot of the specified distribution."
##[1] "Descriptive statistics for this distribution are:"
## Min. 1st Qu. Median Mean 3rd Qu. Max.
##0.001939 0.125475 0.204776 0.223724 0.300515 0.785156
##[1] "Verification: The percentile value 0.4 corresponds to the 0.9th
##percentile"
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.