Description Usage Arguments Value Examples
This function takes in the IV estimate and its IVlike
specification, and generates a list containing the corresponding
IVlike point estimate, and the corresponding moments (gammas) that
will enter into the constraint matrix of the LP problem. If the
option means = FALSE
, then the data are not averaged to
generate the gamma moments and may be used for GMM. The function
requires the user to provide a list (i.e. the list the point
estimates and moments corresponding to other IVlike
specifications; or an empty list) to append these point estimates
and moments to.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 
data 

sset 
list, which is modified and returned as the output. This object will contain all the information from the IVlike specifications that can be used for estimating the treatment effect. 
sest 
list containing the point estimates and Sweights corresponding to a particular IVlike estimand. 
splinesobj 
list of spline components in the MTRs for treated
and control groups. Spline terms are extracted using

pmodobj 
vector of propensity scores. 
pm0 
list of the monomials in the MTR for the control group. 
pm1 
list of the monomials in the MTR for the treated group. 
ncomponents 
The number of components from the IV regression to include in the Sset. 
scount 
integer, an index for the elements in the Sset. 
subset_index 
vector of integers, a row index for the subset of the data the IV regression is restricted to. 
means 
boolean, set to 
yvar 
name of outcome variable. This is only used if

dvar 
name of treatment indicator. This is only used if

noisy 
boolean, default set to 
ivn 
integer, the number indicating which IV specification the component corresponds to. 
redundant 
vector of integers indicating which components in the Sset are redundant. 
A list containing the point estimate for the IV regression, and the expectation of each monomial term in the MTR.
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  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 nonspline 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 Sset, which contains the coefficients and weights
## corresponding to various IVlike estimands
genSSet(data = dtm,
sset = sSet,
sest = ivEstimates,
splinesobj = splinesList,
pmodobj = propensityObj$phat,
pm0 = polynomials0,
pm1 = polynomials1,
ncomponents = 1,
scount = 1)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.