Title: | Generates Prior Distributions for Proportions |
---|---|
Description: | Translates beliefs into prior information in the form of Beta and Gamma distributions. It can be used for the generation of priors on the prevalence of disease and the sensitivity/specificity of diagnostic tests and any other binomial experiment. |
Authors: | Konstantinos Pateras [aut, cre], Polychronis Kostoulas [aut] |
Maintainer: | Konstantinos Pateras <[email protected]> |
License: | GPL (>= 3) |
Version: | 2.0 |
Built: | 2024-10-31 20:17:57 UTC |
Source: | https://github.com/cran/PriorGen |
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 should be 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\
findbeta(themean=NULL, themedian=NULL, themode=NULL, percentile=0.95,lower.v=F, percentile.value, seed=280385, nsims=10000)
findbeta(themean=NULL, themedian=NULL, themode=NULL, percentile=0.95,lower.v=F, percentile.value, seed=280385, nsims=10000)
themean |
specify your prior belief 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 belief 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 belief 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. |
seed |
A fixed seed for replication purposes. |
nsims |
Number of simulations for the creation of various summary metrics of the elicited prior. |
parameters: The beta distribution parameters Beta(a,b)
summary: A basic summary of the elicited prior
input: The initial input value that produced the above prior.
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.
## 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, seed = 280385, nsims = 10000 ) ## 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 ) ##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 than 0.40. findbeta(themode=0.15, percentile=0.90,lower.v=TRUE, percentile.value=0.40)
## 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, seed = 280385, nsims = 10000 ) ## 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 ) ##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 than 0.40. findbeta(themode=0.15, percentile=0.90,lower.v=TRUE, percentile.value=0.40)
A function to estimate the parameters alpha and beta of a Beta distribution based on the existing prior beliefs (data and/or expert opinion). General information should be provided on the mean in terms of c("Very low","Low","Average","High","Very high"). The same holds for the variance parameter.
findbeta_abstract(themean.cat, thevariance.cat, seed=280385, nsims=10000)
findbeta_abstract(themean.cat, thevariance.cat, seed=280385, nsims=10000)
themean.cat |
specify your prior belief about the mean. It takes a value among c("Very low","Low","Average","High","Very high"). |
thevariance.cat |
specify your prior belief about the variance. It takes a value among c("Very low","Low","Average","High","Very high"). |
seed |
A fixed seed for replication purposes. |
nsims |
Number of simulations for the creation of various summary metrics of the elicited prior. |
parameters: The beta distribution parameters Beta(a,b)
summary: A basic summary of the elicited prior
input: The initial input value that produced the above prior.
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.
## Example 1 ## Based on the available literature the mean value for the sensitivity of a test ## is expected to be generally low and its variance not that low but not that much neither. findbeta_abstract(themean.cat = "Low", thevariance.cat = "Average")
## Example 1 ## Based on the available literature the mean value for the sensitivity of a test ## is expected to be generally low and its variance not that low but not that much neither. findbeta_abstract(themean.cat = "Low", thevariance.cat = "Average")
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 should be provided about the mean (or the median or the mode) as a vector corresponding to multiple prior mean prevalences from experts or studies.
findbeta_panel(themean.vec=NULL, themedian.vec=NULL, themode.vec=NULL, seed=280385, nsims=10000)
findbeta_panel(themean.vec=NULL, themedian.vec=NULL, themode.vec=NULL, seed=280385, nsims=10000)
themean.vec |
specify your prior belief about the mean. It takes a vector of means, with values between 0 and 1. Not to be specified if a vector has been given for the median or the mode. |
themedian.vec |
specify your prior belief about the median. It takes a vector of medians, with values between 0 and 1. Not to be specified if a vector has been given for the mean or the mode. |
themode.vec |
specify your prior belief about the mode. It takes a vector of modes, with values between 0 and 1. Not to be specified if a vector has been given for the mean or the median. |
seed |
A fixed seed for replication purposes. |
nsims |
Number of simulations for the creation of various summary metrics of the elicited prior. |
parameters: The beta distribution parameters Beta(a,b)
summary: A basic summary of the elicited prior
input: The initial input value that produced the above prior.
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.
## Example 1 ## Based on the available literature the median/mean/mode value for the specificity of a ## test is expected to be equal to 0.1, 0.2, 0.4, 0.04, 0.01, 0.5 based on opinions of 6 experts. resmed <- findbeta_panel(themedian.vec = c(0.1, 0.2, 0.4, 0.04, 0.01, 0.5)) resmed resmea <- findbeta_panel(themean.vec = c(0.1, 0.2, 0.4, 0.04, 0.01, 0.5)) resmea resmod <- findbeta_panel(themode.vec = c(0.1, 0.2, 0.4, 0.04, 0.01, 0.5)) resmod plot(resmed, lty = 1) lines(resmea, lty = 2) lines(resmod, lty = 3)
## Example 1 ## Based on the available literature the median/mean/mode value for the specificity of a ## test is expected to be equal to 0.1, 0.2, 0.4, 0.04, 0.01, 0.5 based on opinions of 6 experts. resmed <- findbeta_panel(themedian.vec = c(0.1, 0.2, 0.4, 0.04, 0.01, 0.5)) resmed resmea <- findbeta_panel(themean.vec = c(0.1, 0.2, 0.4, 0.04, 0.01, 0.5)) resmea resmod <- findbeta_panel(themode.vec = c(0.1, 0.2, 0.4, 0.04, 0.01, 0.5)) resmod plot(resmed, lty = 1) lines(resmea, lty = 2) lines(resmod, lty = 3)
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 should be provided on the raw values of the mean (or the median or the mode) and a corresponding scale metric, either the variance or the range of the parameter.
findbeta_raw(themean=NULL,themedian=NULL,themode=NULL, thevariance=NULL, therange=c(0,1), seed=280385, nsims=10000)
findbeta_raw(themean=NULL,themedian=NULL,themode=NULL, thevariance=NULL, therange=c(0,1), seed=280385, nsims=10000)
themean |
specify your prior belief 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 belief 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 belief 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. |
thevariance |
specify your prior belief about the variance. If the selected variance is larger than possible, the variance will be adjusted downwards to create comply with the range of a probability. |
therange |
specify your prior belief about the range. It should be a two number vector that c(ul,ll), where ul>0, ll<1 and ul<ll. This scale metric applies for themode and themedian options. |
seed |
A fixed seed for replication purposes. |
nsims |
Number of simulations for the creation of various summary metrics of the elicited prior. |
parameters The beta distribution parameters Beta(a,b)
summary A basic summary of the elicited prior
input The initial input value that produced the above prior.
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.
## Example 1 ## Based on the available literature the mean value for the sensitivity of a test ## is expected to be 0.90 and its variance equals to 0.1. findbeta_raw(themean = 0.90, thevariance = 0.1) ## Example 2 ## Based on the available literature the median value for the specificity of a ## test is expected to be 0.99 and its range between 0.1 and 1. findbeta_raw(themedian = 0.70, therange = c(0.1, 1)) # Mode findbeta_raw(themode = 0.70, therange = c(0.1, 1))
## Example 1 ## Based on the available literature the mean value for the sensitivity of a test ## is expected to be 0.90 and its variance equals to 0.1. findbeta_raw(themean = 0.90, thevariance = 0.1) ## Example 2 ## Based on the available literature the median value for the specificity of a ## test is expected to be 0.99 and its range between 0.1 and 1. findbeta_raw(themedian = 0.70, therange = c(0.1, 1)) # Mode findbeta_raw(themode = 0.70, therange = c(0.1, 1))
A function to estimate (a) the parameters of a Beta distribution for the expected mean of a proportion - usually the prevalence of disease/infection for the units in an area/region and (b) the parameters of a Gamma distribution expressing our prior belief about the variability of the prevalence estimates across the units of the area/region under consideration.
findbetamupsi(themean, percentile=0.95, lower.v=T, percentile.value, psi.percentile=0.90, percentile.median, percentile95value, seed = 280385, nsims = 10000, root.method = "multiroot")
findbetamupsi(themean, percentile=0.95, lower.v=T, percentile.value, psi.percentile=0.90, percentile.median, percentile95value, seed = 280385, nsims = 10000, root.method = "multiroot")
themean |
specify your prior belief about the mean. It takes a value between 0 and 1. |
percentile |
specify the level of confidence that the true value of the mean is greater or lower than the percentile.value. It takes a value between 0 and 1 and the default is 0.95. |
lower.v |
logical, if TRUE the specified percentile.value is the upper limit for the mean at the specified confidence level (percentile). If FALSE the specified percentile.value is the lower limit for the mean at the specified confidence level (percentile).The default is TRUE. |
percentile.value |
specify the upper or lower limit for the mean at the specified level of confidence (percentile). It takes a value between 0 and 1. |
psi.percentile |
specify the level of confidence that a certain fraction of the units under study has a prevalence less than the percentile.median. It takes a value between 0 and 1 and the default is 0.90. |
percentile.median |
specify the median value that corresponds to the defined psi.percentile. It takes a value between 0 and 1 and has to be higher than both themean and the percentile. |
percentile95value |
specify the value that the percentile.median does not exceed with 95% confidence. It takes a value between 0 and 1 and has to be higher than the percentile.median. |
seed |
A fixed seed for replication purposes. |
nsims |
Number of simulations for the creation of various summary metrics of the elicited prior. |
root.method |
Choose between two alternatives to solve the two non-linear equations to identify the hyperparameters of psi. root.method="multiroot" involves the basic function of the rootSolve package, root.method="nleqslv" involves the base functions of the nleqslv package. |
param_beta: The beta distribution parameters Beta(a,b)
param_gamma: The gamma distribution parameters gamma(a,b)
summary: A basic summary of the elicited prior
input: The initial input value that produced the above prior.
param_upper: simulated mu and psi of Beta(mu psi,psi(1-mu))
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.
## Example ## The mean prevalence of a disease/infection for the units within an area/region ## is thought to be 0.20 and we are 99% confident that it is not more than 0.40. ## Within this area, we are also confident that 90% of all units have a prevalence ## less or equal to 0.50 and we are 95% certain that it does not exceed 0.60 res1 <- findbetamupsi( themean = 0.20, percentile = 0.99, lower.v = TRUE, percentile.value = 0.30, psi.percentile = 0.90, percentile.median = 0.50, percentile95value = 0.60 ) res2 <- findbetamupsi( themean = 0.20, percentile = 0.99, lower.v = TRUE, percentile.value = 0.30, psi.percentile = 0.90, percentile.median = 0.50, percentile95value = 0.60, root.method = "nleqslv" ) res1 res2
## Example ## The mean prevalence of a disease/infection for the units within an area/region ## is thought to be 0.20 and we are 99% confident that it is not more than 0.40. ## Within this area, we are also confident that 90% of all units have a prevalence ## less or equal to 0.50 and we are 95% certain that it does not exceed 0.60 res1 <- findbetamupsi( themean = 0.20, percentile = 0.99, lower.v = TRUE, percentile.value = 0.30, psi.percentile = 0.90, percentile.median = 0.50, percentile95value = 0.60 ) res2 <- findbetamupsi( themean = 0.20, percentile = 0.99, lower.v = TRUE, percentile.value = 0.30, psi.percentile = 0.90, percentile.median = 0.50, percentile95value = 0.60, root.method = "nleqslv" ) res1 res2
A function to estimate (a) the parameters of a Beta distribution for the expected mean of a proportion - usually the prevalence of disease/infection for the units in an area/region and (b) the parameters of a Gamma distribution expressing our prior belief about the variability of the prevalence estimates across the units of the area/region under consideration. General information should be provided about the mean in terms of c("Very low","Low","Average","High","Very high"). The same holds for the variance parameter.
findbetamupsi_abstract(themean.cat, thevariance.cat, psi.percentile=0.90, percentile.median, percentile95value, seed = 280385, nsims = 10000, root.method = "multiroot")
findbetamupsi_abstract(themean.cat, thevariance.cat, psi.percentile=0.90, percentile.median, percentile95value, seed = 280385, nsims = 10000, root.method = "multiroot")
themean.cat |
specify your prior belief about the mean. It takes a value among c("Very low","Low","Average","High","Very high"). |
thevariance.cat |
specify your prior belief about the variance. It takes a value among c("Very low","Low","Average","High","Very high"). |
psi.percentile |
specify the level of confidence that a certain fraction of the units under study has a prevalence less than the percentile.median. It takes a value between 0 and 1 and the default is 0.90. |
percentile.median |
specify the median value that corresponds to the defined psi.percentile. It takes a value between 0 and 1 and has to be higher than both themean and the percentile. |
percentile95value |
specify the value that the percentile.median does not exceed with 95% confidence. It takes a value between 0 and 1 and has to be higher than the percentile.median. |
seed |
A fixed seed for replication purposes. |
nsims |
Number of simulations for the creation of various summary metrics of the elicited prior. |
root.method |
Choose between two alternatives to solve the two non-linear equations to identify the hyperparameters of psi. root.method="multiroot" involves the basic function of the rootSolve package, root.method="nleqslv" involves the base functions of the nleqslv package. |
param_beta: The beta distribution parameters Beta(a,b)
param_gamma: The gamma distribution parameters gamma(a,b)
summary: A basic summary of the elicited prior
input: The initial input value that produced the above prior.
param_upper: simulated mu and psi of Beta(mu psi,psi(1-mu))
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.
## Example ## The mean prevalence of a disease/infection for the units within an area/region ## is thought to be generally low and its variance is neither high nor low, ## we are also confident that 90% of all units have a prevalence ## less or equal to 0.60 and we are 95% certain that it does not exceed 0.70 findbetamupsi_abstract( themean.cat = "Low", thevariance.cat = "Average", psi.percentile = 0.90, percentile.median = 0.60, percentile95value = 0.70 ) findbetamupsi_abstract( themean.cat = "Low", thevariance.cat = "Average", psi.percentile = 0.90, percentile.median = 0.60, percentile95value = 0.70, root.method = "nleqslv" )
## Example ## The mean prevalence of a disease/infection for the units within an area/region ## is thought to be generally low and its variance is neither high nor low, ## we are also confident that 90% of all units have a prevalence ## less or equal to 0.60 and we are 95% certain that it does not exceed 0.70 findbetamupsi_abstract( themean.cat = "Low", thevariance.cat = "Average", psi.percentile = 0.90, percentile.median = 0.60, percentile95value = 0.70 ) findbetamupsi_abstract( themean.cat = "Low", thevariance.cat = "Average", psi.percentile = 0.90, percentile.median = 0.60, percentile95value = 0.70, root.method = "nleqslv" )
A function to estimate (a) the parameters of a Beta distribution for the expected mean of a proportion - usually the prevalence of disease/infection for the units in an area/region and (b) the parameters of a Gamma distribution expressing our prior belief about the variability of the prevalence estimates across the units of the area/region under consideration. Information should be provided about the mean as a vector corresponding to multiple prior mean prevalences from experts or studies.
findbetamupsi_panel(themean.vec, psi.percentile=0.90, percentile.median, percentile95value, seed = 280385, nsims = 10000, root.method = "multiroot")
findbetamupsi_panel(themean.vec, psi.percentile=0.90, percentile.median, percentile95value, seed = 280385, nsims = 10000, root.method = "multiroot")
themean.vec |
specify the multiple sources prior belief about the mean as a vector. Each mean should take a value between 0 and 1. |
psi.percentile |
specify the level of confidence that a certain fraction of the units under study has a prevalence less than the percentile.median. It takes a value between 0 and 1 and the default is 0.90. |
percentile.median |
specify the median value that corresponds to the defined psi.percentile. It takes a value between 0 and 1 and has to be higher than both themean and the percentile. |
percentile95value |
specify the value that the percentile.median does not exceed with 95% confidence. It takes a value between 0 and 1 and has to be higher than the percentile.median. |
seed |
A fixed seed for replication purposes. |
nsims |
Number of simulations for the creation of various summary metrics of the elicited prior. |
root.method |
Choose between two alternatives to solve the two non-linear equations to identify the hyperparameters of psi. root.method="multiroot" involves the basic function of the rootSolve package, root.method="nleqslv" involves the base functions of the nleqslv package. |
param_beta: The beta distribution parameters Beta(a,b)
param_gamma: The gamma distribution parameters gamma(a,b)
summary: A basic summary of the elicited prior
input: The initial input value that produced the above prior.
param_upper: simulated mu and psi of Beta(mu psi,psi(1-mu))
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.
## Example ## The mean prevalence of a disease/infection for the units within an area/region ## is thought to be 8%, 20%, 10%, 15% 20% , 22%, 10%, 2%, 2%, 4%, 5%, ## we are also confident that 90% of all units have a prevalence ## less or equal to 0.60 and we are 95% certain that it does not exceed 0.70 findbetamupsi_panel( themean.vec = c( 0.4, 0.2, 0.1, 0.3, 0.4, 0.5, 0.1, 0.02, 0.04, 0.05 ), psi.percentile = 0.90, percentile.median = 0.60, percentile95value = 0.70 ) findbetamupsi_panel( themean.vec = c( 0.4, 0.2, 0.1, 0.3, 0.4, 0.5, 0.1, 0.02, 0.04, 0.05 ), psi.percentile = 0.90, percentile.median = 0.60, percentile95value = 0.70, root.method = "nleqslv" )
## Example ## The mean prevalence of a disease/infection for the units within an area/region ## is thought to be 8%, 20%, 10%, 15% 20% , 22%, 10%, 2%, 2%, 4%, 5%, ## we are also confident that 90% of all units have a prevalence ## less or equal to 0.60 and we are 95% certain that it does not exceed 0.70 findbetamupsi_panel( themean.vec = c( 0.4, 0.2, 0.1, 0.3, 0.4, 0.5, 0.1, 0.02, 0.04, 0.05 ), psi.percentile = 0.90, percentile.median = 0.60, percentile95value = 0.70 ) findbetamupsi_panel( themean.vec = c( 0.4, 0.2, 0.1, 0.3, 0.4, 0.5, 0.1, 0.02, 0.04, 0.05 ), psi.percentile = 0.90, percentile.median = 0.60, percentile95value = 0.70, root.method = "nleqslv" )
A function to estimate (a) the parameters of a Beta distribution for the expected mean of a proportion - usually the prevalence of disease/infection for the units in an area/region and (b) the parameters of a Gamma distribution expressing our prior belief about the variability of the prevalence estimates across the units of the area/region under consideration. Information should be provided on the raw values of the mean, the within-study variance and the psi (between-study variance) parameters.
findbetamupsi_raw(themean = 0.2, thevariance = 0.05, thepsi = 0.5, seed = 280385, nsims = 10000, root.method = "multiroot")
findbetamupsi_raw(themean = 0.2, thevariance = 0.05, thepsi = 0.5, seed = 280385, nsims = 10000, root.method = "multiroot")
themean |
specify your prior belief about the mean. It takes a value between 0 and 1. |
thevariance |
specify your prior belief about thevariance. If the selected variance is larger than possible, the variance will be adjusted downwards to create comply with the range of a probability. |
thepsi |
specify your prior belief about the between-study variance. Large values of psi correspond to low heterogeneity, low values of psi correspond to large heterogeneity. |
seed |
A fixed seed for replication purposes. |
nsims |
Number of simulations for the creation of various summary metrics of the elicited prior. |
root.method |
Choose between two alternatives to solve the two non-linear equations to identify the hyperparameters of psi. root.method="multiroot" involves the basic function of the rootSolve package, root.method="nleqslv" involves the base functions of the nleqslv package. |
param_beta: The beta distribution parameters Beta(a,b)
param_gamma: The gamma distribution parameters gamma(a,b)
summary: A basic summary of the elicited prior
input: The initial input value that produced the above prior.
param_upper: simulated mu and psi of Beta(mu psi,psi(1-mu))
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.
## Example ## The mean prevalence of a disease/infection for the units ## within an area/region is thought to be 0.20 with a variance ## equal to 0.03, with large heterogeneity i.e. psi equals to 0.15. findbetamupsi_raw(themean = 0.20, thevariance = 0.03, thepsi = 0.15) findbetamupsi_raw( themean = 0.20, thevariance = 0.03, thepsi = 0.15, root.method = "nleqslv" )
## Example ## The mean prevalence of a disease/infection for the units ## within an area/region is thought to be 0.20 with a variance ## equal to 0.03, with large heterogeneity i.e. psi equals to 0.15. findbetamupsi_raw(themean = 0.20, thevariance = 0.03, thepsi = 0.15) findbetamupsi_raw( themean = 0.20, thevariance = 0.03, thepsi = 0.15, root.method = "nleqslv" )
A function to estimate the parameters alpha and beta of a Beta distribution based on the existing prior belief (data and/or expert opinion) about the values of two distinct percentiles.
findbetaqq(percentile.value1, percentile1, percentile.value2, percentile2, seed = 280385, nsims=10000)
findbetaqq(percentile.value1, percentile1, percentile.value2, percentile2, seed = 280385, nsims=10000)
percentile.value1 |
specify the value for the first percentile. It takes a value between 0 and 1. |
percentile1 |
specify which is the percentile that corresponds to percentile.value1. It takes a value between 0 and 1. |
percentile.value2 |
specify the value for the second percentile. It takes a value between 0 and 1. |
percentile2 |
specify which is the percentile that corresponds to percentile.value2. It takes a value between 0 and 1. |
seed |
A fixed seed for replication purposes. |
nsims |
Number of simulations for the creation of various summary metrics of the elicited prior. |
parameters: The beta distribution parameters Beta(a,b)
summary: A basic summary of the elicited prior
input: The initial input value that produced the above prior.
Kostoulas, P., Nielsen, S. S., Branscum, A. J., Johnson, W. O., Dendukuri, N., Dhand, N. K., Toft, N., Gardner, I. A. (2017): Reporting guidelines for diagnostic accuracy studies that use Bayesian latent class models (STARD–BLCM). Statistics in medicine, 23, 3603–3604.
## We believe that 20% of the units in an area/region have a prevalence of ## disease/infection less than or equal to 0.30 while at the same time ## we are 90% certain that the prevalence is less than 0.60 findbetaqq( percentile.value1 = 0.30, percentile1 = 0.20, percentile.value2 = 0.60, percentile2 = 0.90 )
## We believe that 20% of the units in an area/region have a prevalence of ## disease/infection less than or equal to 0.30 while at the same time ## we are 90% certain that the prevalence is less than 0.60 findbetaqq( percentile.value1 = 0.30, percentile1 = 0.20, percentile.value2 = 0.60, percentile2 = 0.90 )
A function that plots any object on top of a class findbeta plot.
## S3 method for class 'PriorGen' lines(x, ...)
## S3 method for class 'PriorGen' lines(x, ...)
x |
An object of type findbeta produces of one of the other PriorGen functions. |
... |
More basic plot arguments |
## Example 1 ## Based on the available literature the mean value ## for the sensitivity of a test is expected to be ## generally low and its variance not that low but not that much neither. res_abs_1 <- findbeta_abstract( themean.cat = "Low", thevariance.cat = "Average" ) plot(res_abs_1, main = "Plot of the findbeta_abstract function", lwd = 3, ylim = c(0, 7), type = "l" ) res_abs_2 <- findbeta_abstract( themean.cat = "High", thevariance.cat = "Average" ) lines(res_abs_2, lwd = 3, col = "red") ## Example 2 ## Hierarchical prior res_mult_1 <- findbetamupsi( themean = 0.10, percentile = 0.79, lower.v = TRUE, percentile.value = 0.26, psi.percentile = 0.95, percentile.median = 0.28, percentile95value = 0.3 ) plot(res_mult_1, main = "Plot of the findbetamupsi function", lwd = 3, ylim = c(0, 7) ) res_mult_2 <- findbetamupsi( themean = 0.12, percentile = 0.79, lower.v = TRUE, percentile.value = 0.26, psi.percentile = 0.95, percentile.median = 0.28, percentile95value = 0.3 ) lines(res_mult_2, lwd = 3, col = "red")
## Example 1 ## Based on the available literature the mean value ## for the sensitivity of a test is expected to be ## generally low and its variance not that low but not that much neither. res_abs_1 <- findbeta_abstract( themean.cat = "Low", thevariance.cat = "Average" ) plot(res_abs_1, main = "Plot of the findbeta_abstract function", lwd = 3, ylim = c(0, 7), type = "l" ) res_abs_2 <- findbeta_abstract( themean.cat = "High", thevariance.cat = "Average" ) lines(res_abs_2, lwd = 3, col = "red") ## Example 2 ## Hierarchical prior res_mult_1 <- findbetamupsi( themean = 0.10, percentile = 0.79, lower.v = TRUE, percentile.value = 0.26, psi.percentile = 0.95, percentile.median = 0.28, percentile95value = 0.3 ) plot(res_mult_1, main = "Plot of the findbetamupsi function", lwd = 3, ylim = c(0, 7) ) res_mult_2 <- findbetamupsi( themean = 0.12, percentile = 0.79, lower.v = TRUE, percentile.value = 0.26, psi.percentile = 0.95, percentile.median = 0.28, percentile95value = 0.3 ) lines(res_mult_2, lwd = 3, col = "red")
A function that plots any object of the class findbeta.
## S3 method for class 'PriorGen' plot(x, ...)
## S3 method for class 'PriorGen' plot(x, ...)
x |
An object of type findbeta produces of one of the other PriorGen functions. |
... |
More basic plot arguments |
## Example 1 ## Based on the available literature the mean value for the ## sensitivity of a test is expected to be generally low and ## its variance not that low but not that much neither. res_abs_1 <- findbeta_abstract( themean.cat = "Low", thevariance.cat = "Average" ) plot(res_abs_1, main = "Plot of the findbeta_abstract function", lwd = 3, ylim = c(0, 7) ) ## Example 2 ## Hierarchical prior res_mult_1 <- findbetamupsi( themean = 0.10, percentile = 0.79, lower.v = TRUE, percentile.value = 0.26, psi.percentile = 0.95, percentile.median = 0.28, percentile95value = 0.3 ) plot(res_mult_1, main = "Plot of the findbetamupsi function", lwd = 3, ylim = c(0, 7) )
## Example 1 ## Based on the available literature the mean value for the ## sensitivity of a test is expected to be generally low and ## its variance not that low but not that much neither. res_abs_1 <- findbeta_abstract( themean.cat = "Low", thevariance.cat = "Average" ) plot(res_abs_1, main = "Plot of the findbeta_abstract function", lwd = 3, ylim = c(0, 7) ) ## Example 2 ## Hierarchical prior res_mult_1 <- findbetamupsi( themean = 0.10, percentile = 0.79, lower.v = TRUE, percentile.value = 0.26, psi.percentile = 0.95, percentile.median = 0.28, percentile95value = 0.3 ) plot(res_mult_1, main = "Plot of the findbetamupsi function", lwd = 3, ylim = c(0, 7) )
A function that prints a summary any object of the class PriorGen
print_PriorGen(x)
print_PriorGen(x)
x |
An object of type findbeta produced of one of the main PriorGen functions. |
## Example 1 ## Based on the available literature the mean value for the sensitivity of a test ## is expected to be generally low and its variance not that low but not that much neither. res_abs_1 <- findbeta_abstract(themean.cat = "Low", thevariance.cat = "Average") print_PriorGen(res_abs_1) ## Example 2 ## Hierarchical prior res_mult_1 <- findbetamupsi( themean = 0.10, percentile = 0.79, lower.v = TRUE, percentile.value = 0.26, psi.percentile = 0.95, percentile.median = 0.28, percentile95value = 0.3 ) print_PriorGen(res_mult_1)
## Example 1 ## Based on the available literature the mean value for the sensitivity of a test ## is expected to be generally low and its variance not that low but not that much neither. res_abs_1 <- findbeta_abstract(themean.cat = "Low", thevariance.cat = "Average") print_PriorGen(res_abs_1) ## Example 2 ## Hierarchical prior res_mult_1 <- findbetamupsi( themean = 0.10, percentile = 0.79, lower.v = TRUE, percentile.value = 0.26, psi.percentile = 0.95, percentile.median = 0.28, percentile95value = 0.3 ) print_PriorGen(res_mult_1)
Translates beliefs into prior information in the form of Beta and Gamma distributions. It can be mainly used for the generation of priors on the prevalence of disease and the sensitivity/specificity of diagnostic tests.