# load data set:
data("BaetenEtAl2013")
print(BaetenEtAl2013)
if (FALSE) {
# compute effect sizes (logarithmic odds) from the count data:
as <- escalc(xi=events, ni=total, slab=study,
measure="PLO", data=BaetenEtAl2013)
# estimate the unit information standard deviation (UISD):
uisd(as, individual=TRUE)
uisd(as) # = 2.35
# perform meta-analysis
# (using uniform priors for effect and heterogeneity):
bm <- bayesmeta(as)
# show forest plot:
forestplot(bm, zero=NA, xlab="log-odds")
# compute ESS_ELIR (based on fixed UISD):
ess(bm, uisd=2.35) # = 45.7 patients
# compute ESS_ELIR based on UISD as a function of the log-odds:
uisdLogOdds <- function(logodds)
{
return(2 * cosh(logodds / 2))
}
# Note: in the present example, probabilities are
# at approximately 0.25, corresponding to odds of 1:3.
uisdLogOdds(log(1/3))
# The UISD value of 2.31 roughly matches the above empirical figure.
ess(bm, uisd=uisdLogOdds) # = 43.4 patients
}
Run the code above in your browser using DataLab