Description Usage Arguments Details Value Examples
pidoutcomes
computes the upper and lower bounds on the
conditional expectation function when there are missing outcomes.
It only works for a dependent variable scaled such that
y \in (0,1).
It is based on the work of Manski (2007). Assume we want to estimate
P(y|x) = P(y|x,z=1)P(z=1|x) + P(y|x,z=0)P(z=0|x),
where z
is a binary variable indicating missingness and
y
is a binary outcome.
All of the quantities are identifiable from the data apart from
P(y|x,z=0) which is by definition unobservable. However,
this missing quantity cannot be less than zero or greater than
one so the absolute bounds on the conditional probability are
P(y|x,z=1)P(z=1|x) ≤ P(y|x) ≤ P(y|x,z=1)P(z=1|x) + P(z=0|x).
pidoutcomes()
computes these upper and lower bounds.
1 | pidoutcomes(outformula, z, data, alpha = 0.95, ...)
|
outformula |
A formula |
z |
A column from your data that indicates missing outcomes, must be 0 or 1 |
data |
Your data |
alpha |
The alpha significance level for the CI. Default is |
... |
Other arguments accepted by |
We also compute confidence intervals based on Manski and Imbens (2004). We focus on intervals that are guaranteed to cover the parameter at the specified level, rather than intervals that are guaranteed to cover the bounds at the specified level.
The function returns a list of 4 values: lower_ci
,
lower
, upper
and upper_ci
, each a vector of
length nrow(data)
. These are the lower and upper confidence
intervals on the location
of the parameter (as described in Manski and Imbens (2004)), and the
estimated lower and upper bounds of the partially identified conditional
mean
1 2 3 4 5 6 7 8 9 | #' N <- 1000
x <- rnorm(N)
e <- rnorm(N)
y <- as.numeric(2*x + e > 0)
z <- rbinom(N, 1, .75)
y_obs <- z*y
df <- data.frame(y_obs, x, z)
m1 <- pidoutcomes(y_obs ~ x, z, df)
m1
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.