# NOT RUN {
##### Using Calibrated Method #####
d = metafor::escalc(measure="RR", ai=tpos, bi=tneg,
ci=cpos, di=cneg, data=metadat::dat.bcg)
# obtaining all three estimators and inference
# number of bootstrap iterates
# should be larger in practice
R = 100
confounded_meta( method="calibrated", # for both methods
q = log(0.90),
r = 0.20,
tail="below",
muB = log(1.5),
dat = d,
yi.name = "yi",
vi.name = "vi",
R = 100 )
# passing only arguments needed for prop point estimate
confounded_meta( method="calibrated",
q = log(0.90),
tail="below",
muB = log(1.5),
give.CI = FALSE,
dat = d,
yi.name = "yi",
vi.name = "vi" )
# passing only arguments needed for Tmin, Gmin point estimates
confounded_meta( method="calibrated",
q = log(0.90),
r = 0.10,
tail="below",
give.CI = FALSE,
dat = d,
yi.name = "yi",
vi.name = "vi" )
##### Using Parametric Method #####
# fit random-effects meta-analysis
m = metafor::rma.uni(yi= d$yi,
vi=d$vi,
knha=TRUE,
measure="RR",
method="REML" )
yr = as.numeric(m$b) # metafor returns on log scale
vyr = as.numeric(m$vb)
t2 = m$tau2
vt2 = m$se.tau2^2
# obtaining all three estimators and inference
# now the proportion considers heterogeneous bias
confounded_meta( method = "parametric",
q=log(0.90),
r=0.20,
tail = "below",
muB=log(1.5),
sigB=0.1,
yr=yr,
vyr=vyr,
t2=t2,
vt2=vt2,
CI.level=0.95 )
# passing only arguments needed for prop point estimate
confounded_meta( method = "parametric",
q=log(0.90),
tail = "below",
muB=log(1.5),
sigB = 0,
yr=yr,
t2=t2,
CI.level=0.95 )
# passing only arguments needed for Tmin, Gmin point estimates
confounded_meta( method = "parametric",
q = log(0.90),
sigB = 0,
r = 0.10,
tail = "below",
yr=yr,
t2=t2,
CI.level=0.95 )
# }
Run the code above in your browser using DataLab