Learn R Programming

ivmte (version 1.0.0)

fglsEstimate: FGLS estimate of TE under point identification

Description

If the user sets the argument point = TRUE in the function ivmte, then it is assumed that the treatment effect parameter is point identified. The observational equivalence condition is then set up as a FGLS problem. Solving this FGLS problem recovers the coefficients on the MTR functions m0 and m1. Combining these coefficients with the target gamma moments allows us to estimate the target treatment effect.

Usage

fglsEstimate(sset, gstar0, gstar1, itermax = 2, tol = 1e-08,
  noisy = TRUE)

Arguments

sset

a list of lists constructed from the function genSSet. Each inner list should include a coefficient corresponding to a term in an IV specification, a matrix of the estimates of the gamma moments conditional on (X, Z) for d = 0, and a matrix of the estimates of the gamma moments conditional on (X, Z) for d = 1. The column means of the last two matrices is what is used to generate the gamma moments.

gstar0

vector, the target gamma moments for d = 0.

gstar1

vector, the target gamma moments for d = 1.

itermax

integer, maximum number of iterations allowed in the iterative FGLS process. By default this is set to 2 (two-step FGLS).

tol

tolerance level for iterative FGLS to terminate.

noisy

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.

Value

a list containing the point estimate of the treatment effects, the standard errors, the 90 intervals, the convergence code (see optim), the coefficients on the MTR, and the variance/covariance matrix of the MTR coefficient estimates.

Examples

Run this code
# NOT RUN {
## Declare empty list to be updated (in the event multiple IV like
## specifications are provided
sSet <- list()

## Declare MTR formulas
formula1 = ~ 0 + u
formula0 = ~ 0 + 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(intercept, d),
                          treat = d,
                          list = FALSE)

## Generate target gamma moments
targetGamma <- genTarget(treat = "d",
                         m0 = ~ 1 + u,
                         m1 = ~ 1 + u,
                         uname = u,
                         target = "atu",
                         data = dtm,
                         splinesobj = splinesList,
                         pmodobj = propensityObj,
                         pm0 = polynomials0,
                         pm1 = polynomials1,
                         point = TRUE)

## Construct S-set. which contains the coefficients and weights
## corresponding to various IV-like estimands
sSet <- genSSet(data = dtm,
                sset = sSet,
                sest = ivEstimates,
                splinesobj = splinesList,
                pmodobj = propensityObj$phat,
                pm0 = polynomials0,
                pm1 = polynomials1,
                ncomponents = 2,
                scount = 1,
                yvar = "ey",
                dvar = "d",
                means = FALSE)

## Obtain point estimates using FGLS
fglsEstimate(sset = sSet$sset,
             gstar0 = targetGamma$gstar0,
             gstar1 = targetGamma$gstar1)

# }

Run the code above in your browser using DataLab