mederrData-class {mederrRank} | R Documentation |
Class "mederrData". Data Specification for Identifying the Most Harmful MEdication Errors using a Bayesian Hierarchical Model.
Description
This class encapsulates the data specification for a Bayesian Hierarchical Model used to identify the most harmful medication errors as described in Myers et al. (2011).
Objects from the Class
Objects can be created by calls of the form new("mederrData", data)
, where the data
argument has to be a matrix or a data frame object that contains the following (numeric) information for each error profile/hospital combination:
the number of times (
y
) that profilei
in hospitalj
was reported with harm;the total number of times (
N
) that the error profilei
is cited on a report from hospitalj
,the error profile
i
identification code,the hospital
j
identification code.
Slots
data
:Object of class
"data.frame"
; data in the standarddata.frame
form.size
:Object of class
"numeric"
; total number of observations in the data set.numi
:Object of class
"numeric"
; number of error profiles available in the data set.numj
:Object of class
"numeric"
; number of hospitals available in the data set.
Methods
- plot
signature(x = "mederrData", y = "missing")
: Provides a pictorial representation for a sample of error profiles reported by some hospitals.- summary
signature(object = "mederrData")
: Summarizes information about anmederrData
object.
Author(s)
Sergio Venturini sergio.venturini@unicatt.it,
Jessica A. Myers jmyers6@partners.org
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
bayes.rank
,
bhm.mcmc
,
bhm.resample
,
mixnegbinom.em
.
Examples
ng <- 50
i <- rep(1:ng, ng)
j <- rep(1:ng, each = ng)
N <- rpois(ng^2, 3 + .05*i - .01*j) + 1
theta_i <- rgamma(ng, 5, 5) - 4/5
delta_j <- rnorm(ng, 0, .2)
logit <- -3 + theta_i[i] + delta_j[j]
y <- rbinom(ng^2, N, exp(logit)/(1 + exp(logit)))
simdata <- new("mederrData", data = cbind(y, N, i, j))