Learn R Programming

mederrRank (version 0.1.0)

p.value: Posterior Predictive Test statistics

Description

This function computes posterior predictive test statistics as described in Myers et al. (2011).

Usage

p.value(reps)

Value

p-value creates a list of p-values.

Arguments

reps

list of replications created with the post.rep function.

Author

Sergio Venturini sergio.venturini@unicatt.it,

Jessica A. Myers jmyers6@partners.org

Details

For further details see Myers et al. (2011).

References

Myers, J. A., Venturini, S., Dominici, F. and Morlock, L. (2011), "Random Effects Models for Identifying the Most Harmful Medication Errors in a Large, Voluntary Reporting Database". Technical Report.

See Also

bhm.constr.resamp, bhm.mcmc, bhm.resample, post.rep.

Examples

Run this code
if (FALSE) {
data("simdata", package = "mederrRank")
summary(simdata)

fit <- bhm.mcmc(simdata, nsim = 1000, burnin = 500, scale.factor = 1.1)
resamp <- bhm.resample(fit, simdata, p.resample = .1,
	k = c(3, 6, 10, 30, 60, Inf), eta = c(.5, .8, 1, 1.25, 2))
fit2 <- bhm.constr.resamp(fit, resamp, k = 3, eta = .8)
reps <- post.rep(fit2, simdata)
pvalues <- p.value(reps)
}

Run the code above in your browser using DataLab