
Last chance! 50% off unlimited learning
Sale ends in
This function takes in the IV estimate and its IV-like specification, and generates a list containing the corresponding point estimate, and the corresponding moments (gammas) that will enter into the constraint matrix of the LP problem.
genSSet(data, sset, sest, splinesobj, pmodobj, pm0, pm1, ncomponents,
scount, subset_index, means = TRUE, yvar, dvar, noisy = TRUE,
ivn = NULL, redundant = NULL)
data.frame
used to estimate the treatment
effects.
A list, which is modified and returned as the output.
A list containing the point estimates and S-weights corresponding to a particular IV-like estimand.
list of spline components in the MTRs for treated
and control groups. Spline terms are extracted using
removeSplines
.
A vector of propensity scores.
A list of the monomials in the MTR for d = 0.
A list of the monomials in the MTR for d = 1.
The number of components from the IV regression we want to include in the S-set.
A counter for the number of elements in the S-set.
An index for the subset of the data the IV regression is restricted to.
boolean, set to TRUE
by default. If set to
TRUE
, then the gamma moments are returned, i.e. sample
averages are taken. If set to FALSE
, then no sample
averages are taken, and a matrix is returned. The sample
average of each column of the matrix corresponds to a
particular gamma moment.
name of outcome variable. This is only used if
means = FALSE
, which occurs when the user believes the
treatment effect is point identified.
name of treatment indicator. This is only used if
means = FALSE
, which occurs when the user believes the
treatment effect is point identified.
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 number indicating which IV specification the component corresponds to.
vector of integers indicating which components in the S-set are redundant.
A list containing the point estimate for the IV regression, and the expectation of each monomial term in the MTR.
# NOT RUN {
dtm <- ivmte:::gendistMosquito()
## Declare empty list to be updated (in the event multiple IV like
## specifications are provided)
sSet <- list()
## Declare MTR formulas
formula1 = ~ 1 + u
formula0 = ~ 1 + u
## Construct object that separates out non-spline components of MTR
## formulas from the spline components. The MTR functions are
## obtained from this object by the function 'genSSet'.
splinesList = list(removeSplines(formula0), removeSplines(formula1))
## Construct MTR polynomials
polynomials0 <- polyparse(formula = formula0,
data = dtm,
uname = u,
as.function = FALSE)
polynomials1 <- polyparse(formula = formula0,
data = dtm,
uname = u,
as.function = FALSE)
## Generate propensity score model
propensityObj <- propensity(formula = d ~ z,
data = dtm,
link = "linear")
## Generate IV estimates
ivEstimates <- ivEstimate(formula = ey ~ d | z,
data = dtm,
components = l(d),
treat = d,
list = FALSE)
## Construct S-set, which contains the coefficients and weights
## coresponding to various IV-like estimands
genSSet(data = dtm,
sset = sSet,
sest = ivEstimates,
splinesobj = splinesList,
pmodobj = propensityObj$phat,
pm0 = polynomials0,
pm1 = polynomials1,
ncomponents = 1,
scount = 1)
# }
Run the code above in your browser using DataLab