Learn R Programming

SHELF (version 1.1.0)

fitprecision: Fit a distribution to judgements about a population precision

Description

Takes elicited probabilities about proportion of a population lying in a specfied interval as inputs, converts the judgements into probability judgements about the population precision, and fits gamma and lognormal distributions to these judgements using the fitdist function.

Usage

fitprecision(interval, propvals, propprobs = c(0.05, 0.95),
  trans = "identity", pplot = TRUE, fontsize = 18)

Arguments

interval
A vector specifying the endpoints of an interval $[k_1, k_2]$.
propvals
A vector specifying two values $\theta_1, \theta_2$ for the proportion.
propprobs
A vector specifying two probabilities $p_1, p_2$.
trans
A string variable taking the value "identity", "log" or "logit" corresponding to whether the population distribution is normal, lognormal or logit-normal respectively.
pplot
Plot the population distributions with median set at $k_1$ and precision fixed at the two elicited quantiles implied by propvals and propprobs.
fontsize
Font size used in the plots.

Value

  • GammaParameters of the fitted gamma distribution. Note that E(precision) = shape / rate.
  • Log.normalParameters of the fitted log normal distribution: the mean and standard deviation of log precision.
  • valsThe elicited values $\theta_1, \theta_2$
  • probsThe elicited probabilities $p_1, p_2$
  • limitsThe lower and upper limits specified by each expert (+/- Inf if not specified).
  • transformTransformation used for a normal population distribution.

Details

The expert provides a pair of probability judgements $$P(\theta < \theta_1 ) = p_1,$$ and $$P(\theta < \theta_2) = p_2,$$ where $\theta$ is the proportion of the population that lies in the interval $[k_1, k_2]$. The judgements are made conditional on the population median equalling $k_1$. Note that, unlike the fitdist command, a 'best fitting' distribution is not reported, as the distributions are fitted to two elicited probabilities only.

Examples

Run this code
fitprecision(interval=c(60, 70), propvals=c(0.2, 0.4), trans = "log")

Run the code above in your browser using DataLab