This function provides a general framework for using the marginal treatment effect (MTE) to extrapolate. The model is the same binary treatment instrumental variable (IV) model considered by Imbens and Angrist (1994) and Heckman and Vytlacil (2005). The framework on which this function is based was developed by Mogstad, Santos and Torgovitsky (2018). See also the recent survey paper on extrapolation in IV models by Mogstad and Torgovitsky (2018).
ivmte(bootstraps = 0, bootstraps.m, bootstraps.replace = TRUE,
levels = c(0.99, 0.95, 0.9), ci.type = "both", pvalue.tol = 1e-08,
ivlike, data, subset, components, propensity, link = "logit", treat,
m0, m1, uname = u, target, target.weight0 = NULL, target.weight1,
target.knots0, target.knots1 = NULL, late.Z, late.from, late.to,
late.X, eval.X, genlate.lb, genlate.ub, obseq.tol = 0.05,
grid.nu = 20, grid.nx = 20, audit.nx = 20, audit.nu = 20,
audit.max = 10, audit.tol = 1e-08, m1.ub, m0.ub, m1.lb, m0.lb,
mte.ub, mte.lb, m0.dec, m0.inc, m1.dec, m1.inc, mte.dec, mte.inc,
lpsolver = NULL, point = FALSE, noisy = TRUE, seed = 12345)
integer, default set to 0.
integer, default set to size of data
set. Determines the size of the subsample drawn from the
original data set when performing inference via the
bootstrap. This option applies only to the case of constructing
confidence intervals for treatment effect bounds, i.e. it does
not apply when point = TRUE
.
boolean, default set to TRUE
. This
determines whether the resampling procedure used for inference
will sample with replacement.
vector, real numbers between 0 and 1. Values correspond to the level of the confidence intervals constructed via bootstrap.
character, default set to 'both'. Set to 'forward' to construct the forward confidence interval for the treatment effect bound. Set to 'backward' to construct the backward confidence interval for the treatment effect bound. Set to 'both' to construct both types of confidence intervals.
numeric, default set to 1e-08. Tolerance level for determining p-value of treatment effect bound.
formula or vector of formulas used to specify the regressions for the IV-like estimands.
data.frame
used to estimate the treatment
effects.
single subset condition or list of subset conditions
corresponding to each IV-like estimand. The input must be
logical. See l
on how to input the argument. If
the user wishes to select specific rows, construct a binary
variable in the data set, and set the condition to use only
those observations for which the binary variable is 1, e.g. the
binary variable is use
, and the subset condition is
use == 1
.
a list of vectors of the terms/components from
the regressions specifications we want to include in the set of
IV-like estimands. To select the intercept term, include in the
vector of variable names, `intercept'. If the the factorized
counterpart of a variable x = 1, 2, 3
is included in the
IV-like specifications via factor(x)
, the user can
select the coefficients for specific factors by declaring the
components factor(x)-1, factor(x)-2, factor(x)-3
. See
l
on how to input the argument. If no components
for a IV specification are given, then all components from that
IV specification will be included.
formula or variable name corresponding to propensity to take up treatment. If a formula is declared, then the function estimates propensity score according to the formula and link specified. If a variable name is declared, then the corresponding column in the data is taken as the vector of propensity scores.
name of link function to estimate propensity score. Can
be chosen from linear
, probit
, or
logit
. Default is set to "logit".
variable name for treatment indicator
one-sided formula for marginal treatment response
function for control group. Splines can also be incorporated
using the expression "uSplines(degree, knots, intercept)". The
'intercept' argument may be omitted, and is set to TRUE
by default.
one-sided formula for marginal treatment response
function for treated group. Splines can also be incorporated
using the expression "uSplines(degree, knots, intercept)". The
'intercept' argument may be omitted, and is set to TRUE
by default.
variable name for unobservable used in declaring MTRs.
target parameter to be estimated. Currently function
allows for ATE ("ate
"), ATT ("att
"), ATU
("atu
"), LATE ("late
"), and generalized LATE
("genlate
").
user-defined weight function for the control
group defining the target parameter. A list of functions can be
submitted if the weighting function is in fact a spline. The
arguments of the function should be variable names in
data
. If the weight is constant across all observations,
then the user can instead submit the value of the weight
instead of a function.
user-defined weight function for the treated
group defining the target parameter. A list of functions can be
submitted if the weighting function is in fact a spline. The
arguments of the function should be variable names in
data
. If the weight is constant across all observations,
then the user can instead submit the value of the weight
instead of a function.
user-defined set of functions defining the
knots associated with splines weights for the control
group. The arguments of the function should consist only of
variable names in data
. If the knots are constant across
all observations, then the user can instead submit the vector
of knots instead of a function.
user-defined set of functions defining the
knots associated with splines weights for the treated
group. The arguments of the function should be variable names
in data
. If the knots are constant across all
observations, then the user can instead submit the vector of
knots instead of a function.
vector of variable names used to define the LATE.
baseline set of values of Z used to define the LATE.
comparison set of values of Z used to define the LATE.
vector of variable names of covariates which we condition on when defining the LATE.
numeric vector of the values at which we condition
variables in late.X
on when estimating the LATE.
lower bound value of unobservable u for estimating generalized LATE.
upper bound value of unobservable u for estimating generalized LATE.
threshold for violation of observational equivalence. The threshold enters in multiplicatively. Thus, a value of 0 corresponds to no violation of observational equivalence other than statistical noise, and the assumption that the model is correctly specified.
number of evenly spread points in the interval [0, 1] of the unobservable u used to form the grid for imposing shape restrictions on the MTRs.
number of evenly spread points of the covariates to use to form the grid for imposing shape restrictions on the MTRs.
number of points on the covariates space to audit in each iteration of the audit procedure.
number of points in the interval [0, 1], corresponding to the normalized value of the unobservable term, to audit in each iteration of the audit procedure.
maximum number of iterations in the audit procedure.
tolerance for determining when to end the audit procedure.
numeric value for upper bound on MTR for treated group. By default, this will be set to the largest value of the observed outcome in the estimation sample.
numeric value for upper bound on MTR for control group. By default, this will be set to the largest value of the observed outcome in the estimation sample.
numeric value for lower bound on MTR for treated group. By default, this will be set to the smallest value of the observed outcome in the estimation sample.
numeric value for lower bound on MTR for control group. By default, this will be set to the smallest value of the observed outcome in the estimation sample.
numeric value for upper bound on treatment effect paramter of interest.
numeric value for lower bound on treatment effect paramter of interest.
logical, equal to TRUE if we want MTR for control group to be weakly monotone decreasing.
logical, equal to TRUE if we want MTR for control group to be weakly monotone increasing.
logical, equal to TRUE if we want MTR for treated group to be weakly monotone decreasing.
logical, equal to TRUE if we want MTR for treated group to be weakly monotone increasing.
logical, equal to TRUE if we want the MTE to be weakly monotone decreasing.
logical, equal to TRUE if we want the MTE to be weakly monotone decreasing.
name of the linear programming package in R used to obtain the bounds on the treatment effect.
boolean, default set to FALSE
. Set to
TRUE
if it is believed that the treatment effects are
point identified. If set to TRUE
, then a two-step GMM
procedure is implemented to estimate the treatment
effects. Shape constraints on the MTRs will be ignored under
point identification.
boolean, default set to TRUE
. If TRUE
,
then messages are provided throughout the estimation
procedure. Set to FALSE
to suppress all messages,
e.g. when performing the bootstrap.
integer, the seed that determines the random grid in the audit procedure.
Returns a list of results from throughout the estimation procedure. This includes all IV-like estimands; the propensity score model; bounds on the treatment effect; the estimated expectations of each term in the MTRs; the components and results of the LP problem.
# NOT RUN {
ivlikespecs <- c(ey ~ d | z,
ey ~ d | factor(z),
ey ~ d,
ey ~ d | factor(z))
jvec <- l(d, d, d, d)
svec <- l(, , , z %in% c(2, 4))
ivmte(ivlike = ivlikespecs,
data = dtm,
components = jvec,
propensity = d ~ z,
subset = svec,
m0 = ~ u + I(u ^ 2),
m1 = ~ u + I(u ^ 2),
uname = u,
target = "att",
m0.dec = TRUE,
m1.dec = TRUE,
bootstraps = 0,
lpsolver = "lpSolveAPI")
# }
Run the code above in your browser using DataLab