Learn R Programming

mederrRank (version 0.1.0)

bhm.constr.resamp: Markov Chain Monte Carlo Estimation (Step 2) of the Bayesian Hierarchical Model for Identifying the Most Harmful Medication Errors

Description

This function represents the "constructor" function for the resampling procedure used in this package. bhm.resample calculates the importance ratios, and performs the sampling, and then this function constructs the resampled model based on that information.

Usage

bhm.constr.resamp(model, resample, k, eta)

Value

bhm.constr.resamp returns an object of the class "mederrFit".

Arguments

model

an object of class "mederrFit".

resample

an object of class "mederrResample".

k

\(k\) (number of degrees of freedom) value to use in the resampling procedure.

eta

\(\eta\) (skewing paramter) value to use in the resampling procedure.

Author

Sergio Venturini sergio.venturini@unicatt.it,

Jessica A. Myers jmyers6@partners.org

Details

Deviations from the normal, i.e. \((k = \infty, \eta = 1)\), random effects distribution using a different pair of \(k\) and \(\eta\) values are considered. The methodology implemented here is the importance link function resampling approach introduce by MacEachern and Peruggia (2000): based on the \((k = \infty, \eta = 1)\) chain, new posterior samples under a new set of \((k, \eta)\) values is obtained.

References

MacEachern, S. and Peruggia, M. (2000), "Importance Link Function Estimation for Markov Chain Monte Carlo Methods", Journal of Computational and Graphical Statistics, 9, 99-121.

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.mcmc, bhm.resample, mederrData, mederrFit.

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)
plot(fit, fit2, simdata)

theta0 <- c(10, 6, 100, 100, .1)
ans <- mixnegbinom.em(simdata, theta0, 50000, 0.01, se = TRUE,
	stratified = TRUE)

summary(fit2, ans, simdata)
}

Run the code above in your browser using DataLab