analyze2x2xK
performs a causal Bayesian analysis
of a 2 x 2 x K table in which it is assumed that unmeasured
confounding is present. The binary treatment variable is denoted
$X = 0$ (control), $1$ (treatment); the binary
outcome variable is denoted $Y = 0$ (failure), $1$
(success); and the categorical measured confounder is denoted
$W=0, ..., K-1$. The notation and terminology are
from Quinn (2008). analyze2x2xK(SimpleTableList, Wpriorvector)
SimpleTable
objects
formed by using analyze2x2
to analyze the $K$ conditional
$(X,Y)$ tables given each level of the measured confounder
$W$. Wpriorvector
corresponds to the $k$th element of
$W$. SimpleTable
.
analyze2x2xK
performs the Bayesian analysis of a 2 x 2 x K
table described in Quinn (2008). summary
and plot
methods can be used to examine the output.
ConfoundingPlot
, analyze2x2
, ElicitPsi
, summary.SimpleTable
, plot.SimpleTable
## Not run:
# ## Example from Quinn (2008)
# ## (original data from Oliver and Wolfinger. 1999.
# ## ``Jury Aversion and Voter Registration.''
# ## American Political Science Review. 93: 147-152.)
# ##
# ##
# ## W=0
# ## Y=0 Y=1
# ## X=0 1 21
# ## X=1 10 93
# ##
# ##
# ## W=1
# ## Y=0 Y=1
# ## X=0 5 32
# ## X=1 27 92
# ##
# ##
# ## W=2
# ## Y=0 Y=1
# ## X=0 4 44
# ## X=1 52 186
# ##
# ##
# ## W=3
# ## Y=0 Y=1
# ## X=0 7 20
# ## X=1 19 47
# ##
# ##
# ## W=4
# ## Y=0 Y=1
# ## X=0 2 26
# ## X=1 6 55
# ##
#
#
# ## a prior belief in an essentially negative monotonic treatment effect
# ## with the largest effects among those for whom W <= 2
#
# S.mono.0 <- analyze2x2(C00=1, C01=21, C10=10, C11=93,
# a00=.25, a01=.25, a10=.25, a11=.25,
# b00=0.02, c00=10, b01=25, c01=3,
# b10=3, c10=25, b11=10, c11=0.02)
#
# S.mono.1 <- analyze2x2(C00=5, C01=32, C10=27, C11=92,
# a00=.25, a01=.25, a10=.25, a11=.25,
# b00=0.02, c00=10, b01=25, c01=3,
# b10=3, c10=25, b11=10, c11=0.02)
#
# S.mono.2 <- analyze2x2(C00=4, C01=44, C10=52, C11=186,
# a00=.25, a01=.25, a10=.25, a11=.25,
# b00=0.02, c00=10, b01=25, c01=3,
# b10=3, c10=25, b11=10, c11=0.02)
#
# S.mono.3 <- analyze2x2(C00=7, C01=20, C10=19, C11=47,
# a00=.25, a01=.25, a10=.25, a11=.25,
# b00=0.02, c00=10, b01=15, c01=1,
# b10=1, c10=15, b11=10, c11=0.02)
#
# S.mono.4 <- analyze2x2(C00=2, C01=26, C10=6, C11=55,
# a00=.25, a01=.25, a10=.25, a11=.25,
# b00=0.02, c00=10, b01=15, c01=1,
# b10=1, c10=15, b11=10, c11=0.02)
#
# S.mono.all <- analyze2x2xK(list(S.mono.0, S.mono.1, S.mono.2,
# S.mono.3, S.mono.4),
# c(0.2, 0.2, 0.2, 0.2, 0.2))
#
# summary(S.mono.all)
# plot(S.mono.all)
#
# ## End(Not run)
Run the code above in your browser using DataLab