Description Usage Arguments Details Author(s) References See Also Examples
View source: R/ConfoundingPlot.R
ConfoundingPlot
implements the "confounding plot"
discussed in Quinn (2008). This plot displays, in the context of
binary treatment (X = 0: control, 1:
treatment) and binary outcome (Y = 0: failure,
1: success), all types of unmeasured confounding that would
keep a true causal effect of interest within some user-defined
tolerance of the estimated causal effect.
1 2 3 4 5 6 |
theta00 |
The observed joint probability that
X is control and Y is failure (Pr(X=0, Y=0)). In a 2 x 2 table in which C00 is
the number of observations in the (X=0, Y=0)
cell and in which there are C total observations one can
consistently estimate |
theta01 |
The observed joint probability that
X is control and Y is success (Pr(X=0, Y=1)). In a 2 x 2 table in which C01 is
the number of observations in the (X=0, Y=1)
cell and in which there are C total observations one can
consistently estimate |
theta10 |
The observed joint probability that
X is treatment and Y is failure (Pr(X=1, Y=0)). In a 2 x 2 table in which C10 is
the number of observations in the (X=1, Y=0)
cell and in which there are C total observations one can
consistently estimate |
theta11 |
The observed joint probability that
X is treatment and Y is success (Pr(X=1, Y=1)). In a 2 x 2 table in which C11 is
the number of observations in the (X=1, Y=1)
cell and in which there are C total observations one can
consistently estimate |
conditioning |
A string detailing whether the post-intervention
distribution, and hence the estimand of interest, is restricted to a
particular subgroup. Possible values are: |
PrY1.setX0 |
Optional value giving the assumed
probability that a randomly chosen unit will have Y=1
(success) if its X value is set to 0 (control) by
outside intervention. If |
PrY1.setX1 |
Optional value giving the assumed
probability that a randomly chosen unit will have Y=1
(success) if its X value is set to 1 (treatment) by
outside intervention. If |
PrY1.setX0.withinTreated |
Optional value giving the
assumed probability that a randomly chosen unit which
received treatment would have Y=1 (success) if its
X value were set to 0 (control) by outside
intervention. If |
PrY1.setX1.withinControl |
Optional value giving the
assumed probability that a randomly chosen unit which
received control would have Y=1 (success) if its
X value were set to 1 (treatment) by outside
intervention. If |
epsilon |
A scalar or array of tolerance values between 0 and
1. The plot depicts all regions of the space of confounders for
which the absolute difference between the true post-intervention
distribution and the assumed post-intervention distribution is
less than |
color |
An array of colors for the plotting
regions. |
legend |
Logical value indicating whether a legend should be printed. |
For full details see Quinn (2008).
Kevin M. Quinn
Quinn, Kevin M. 2008. “What Can Be Learned from a Simple Table: Bayesian Inference and Sensitivity Analysis for Causal Effects from 2 x 2 and 2 x 2 x K Tables in the Presence of Unmeasured Confounding.” Working Paper.
analyze2x2
, analyze2x2xK
, ElicitPsi
,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | ## Example from Quinn (2008)
## (original data from Oliver and Wolfinger. 1999.
## ``Jury Aversion and Voter Registration.''
## American Political Science Review. 93: 147-152.)
##
## Y=0 Y=1
## X=0 19 143
## X=1 114 473
##
C <- 19 + 143 + 114 + 473
theta00 <- 19/C
theta01 <- 143/C
theta10 <- 114/C
theta11 <- 473/C
## may have to adjust size of graphics device to make labels readable
ConfoundingPlot(theta00=theta00, theta01=theta01,
theta10=theta10, theta11=theta11, legend=TRUE)
## same data but with various epsilons and a legend
## may have to adjust size of graphics device to make labels readable
ConfoundingPlot(theta00=theta00, theta01=theta01,
theta10=theta10, theta11=theta11,
epsilon=c(.01, .025, .05, .1),
color=c("black", "darkblue", "blue", "cyan"),
legend=TRUE)
## same data but reference distribution is now just within the treated
## may have to adjust size of graphics device to make labels readable
ConfoundingPlot(theta00=theta00, theta01=theta01,
theta10=theta10, theta11=theta11,
conditioning="Treated", legend=TRUE)
## set PrY1.setX0 and PrY1.setX1 in order to get a reference
## post-intervention distribution that is consistent with
## ATE = -0.2 (note there are many ways to do this)
## may have to adjust size of graphics device to make labels readable
ConfoundingPlot(theta00=theta00, theta01=theta01,
theta10=theta10, theta11=theta11,
PrY1.setX0=.9, PrY1.setX1=.7,
legend=TRUE)
## another way to get ATE = -0.2
## may have to adjust size of graphics device to make labels readable
ConfoundingPlot(theta00=theta00, theta01=theta01,
theta10=theta10, theta11=theta11,
PrY1.setX0=.85, PrY1.setX1=.65,
legend=TRUE)
## a way to get ATE = -0.2 that is impossible given the observed data
## (note the complete lack of any shaded regions in the left panel of plot)
## may have to adjust size of graphics device to make labels readable
ConfoundingPlot(theta00=theta00, theta01=theta01,
theta10=theta10, theta11=theta11,
PrY1.setX0=.5, PrY1.setX1=.3,
legend=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.