Description Usage Arguments Details Value Author(s) References Examples

View source: R/shapeparameter.R

The function returens the shapeparameters a ad b of a beta-distribution from the mean, the lower and upper limit of the 95% confidence or credible interval. The derivation from mean and se to the shapeparameters of a beta-distribution is done by the method of moments.

1 | ```
shapeparameter(m, lwr=NA, upr=NA, se=NA)
``` |

`m` |
mean |

`lwr` |
lower limit of the 95percent confidence/credible interval |

`upr` |
upper limit of the 95percent confidence/credible interval |

`se` |
standard error of the proportion |

Either se or both lwr and upr has to be given. The result may be more reliable if se is given, since the calculation is based on se. If the lwr and upr limits of the 95% confidence interval are given, se is estimated as 1/4 times the width of the 95% confidence interval.

`a` |
parameter a of a beta-distribution |

`b` |
parameter b of a beta-distribution |

Fraenzi Korner-Nievergelt

Gelman et al. (2004)

1 2 3 4 5 | ```
a <- shapeparameter(0.8, 0.72, 0.88)$a
b <- shapeparameter(0.8, 0.72, 0.88)$b
x <- seq(0, 1, by=0.01)
y <- dbeta(x, a, b)
plot(x, y, type="l")
``` |

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.