mederrData-class | R Documentation |
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 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 profile i
in hospital j
was reported with harm;
the total number of times (N
) that the error profile i
is cited on a report from hospital j
,
the error profile i
identification code,
the hospital j
identification code.
data
:Object of class "data.frame"
; data in the standard data.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.
signature(x = "mederrData", y = "missing")
: Provides a pictorial representation for a sample of error profiles reported by some hospitals.
signature(object = "mederrData")
: Summarizes information about an mederrData
object.
Sergio Venturini sergio.venturini@unicatt.it,
Jessica A. Myers jmyers6@partners.org
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.
bayes.rank
,
bhm.mcmc
,
bhm.resample
,
mixnegbinom.em
.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.