Description Usage Arguments Details Author(s) References See Also Examples
Calculates the posterior distribution given data data and prior priormix, where the prior is an empirical Bayes powerprior (Gravestock&Held, 2017). Supports beta-binomial and normal-normal model.
1 2 3 4 5 6 | ## S3 method for class 'powerprior'
postmix(priormix, data, n, r, m, se, p.prior.a, p.prior.b, ...)
## S3 method for class 'betaMix'
powerprior(prior, n, r, p.prior.a, p.prior.b, ...)
## S3 method for class 'normMix'
powerprior(prior, n, m, sigma, ...)
|
priormix |
prior object created by |
prior |
An RBesT mixture object with a single mixture component |
data |
individual data as in |
n |
sample size |
r |
number of successes |
m |
sample mean |
se |
sample standard error |
sigma |
standard deviation |
p.prior.a |
in case of binary outcome, shape1 parameter of initial beta prior for successes |
p.prior.b |
in case of binary outcome, shape2 parameter of initial beta prior for successes |
... |
currently not supported |
Extends postmix. See its documentation for further details on arguments.
powerprior and postmix.powerprior are equivalent except that the former accepts a single component mixture object while the latter accepts a powerprior object created by as.powerprior. powerprior may be deprecated in the future.
Manuel Wiesenfarth
Gravestock, I. and Held, L. (2017). Adaptive power priors with empirical bayes for clinical trials. Pharmaceutical statistics, 16(5):349-360.
package StudyPrior
1 2 3 4 5 6 7 8 9 10 11 12 | ######################
# Normal Outcome
# standard deviation
sigma=1
# prior with nominal prior ESS=50
inf=c(0,1/sqrt(50))
info <-mixnorm(informative=c(1, inf), sigma=sigma)
n=10
posterior=postmix(as.powerprior(info),n = n,m=1,se=sigma/sqrt(n))
plot(posterior)
pmix(posterior, 1.5, lower.tail = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.