Learn R Programming

⚠️There's a newer version (1.4.0) of this package.Take me there.

IV-MTE

R package for Mogstad, Santos, Torgovitsky (2017).

Copy Link

Version

Install

install.packages('ivmte')

Monthly Downloads

280

Version

1.0.1

License

GPL-2 | GPL-3

Maintainer

Joshua Shea

Last Published

May 16th, 2019

Functions in ivmte (1.0.1)

combinemonobound

Combining the boundedness and monotonicity constraint objects
constructConstant

Construct constant function
genSSet

Generating LP moments for IV-like estimands
gendist4

Generate test distribution 4
genGammaTT

Function to generate gamma moments for 'testthat'
gengrid

Generating the grid for the audit procedure
gendistBasic

Generate basic data set for testing
genmonoA

Generate LP components of the monotonicity constraints
dts

Splines data set distribution
dtm

Mosquito data set
fmtResult

Format result for display
design

Generating design matrices
diffA

Taking first differences of constraint matrices
extractcols

Auxiliary function: extracting columns by component names
genGammaSplinesTT

Generating the Gamma moments for splines, for 'testthat'
genboundA

Generating the LP constraint matrix for bounds
genGammaSplines

Generate Gamma moments for splines
lpSetup

Constructing LP problem
dtsf

Splines data set
gendist1e

Generate test distribution 1 with errors
mInt

Function to generate integral of m0 and m1
gendist1

Generate test distribution 1
wAttSplines

Target weighting function, for ATT
negationCheck

Check if custom weights are negations of each other
modcall

Auxiliary function: modifying calls
splineUpdate

Constructing higher order splines
splinesBasis

Evaluating splines basis functions
genpolynomial

Generating polynomial functions
getXZ

Auxiliary function: extract X and Z covariates from a formula
boundPValue

Construct p-values for treatment effects under partial identification
gendist2

Generate test distribution 2
funEval

Evaluate a particular function
ivj

IV weights
matchrow

Auxiliary function: matching rows in data to a vector
dtc

Covariates data set distribution
maxminmatch

Auxiliary function: finding the max/min within a group in a data set
genmonomial

Generating monomials
genmonoboundA

Generating monotonicity and boundedness constraints
polylisteval

Evaluating polynomials
ivmte

Instrumental Variables: Extrapolation by Marginal Treatment Effects
dtcf

Covariates data set
gendistSplines

Generate test data set with splines
polyparse

Parsing marginal treatment response formulas
wgenlate1

Target weight for generalized LATE
whichforlist

Auxiliary function: which for lists
genBasisSplines

Generate basis matrix for splines
dtb

Basic data set distribution
genej

Auxiliary function: generating basis vectors
genGamma

Estimating expectations of terms in the MTR (gamma objects)
isfunctionstring

Auxiliary function: check if string is command
wald

Wald weights
obsEqMin

Minimizing violation of observational equivalence
dtbf

Basic data set
gendist3

Generate test distribution 3
olsj

OLS weights
popmean

Calulating population mean
genTarget

Generating LP moments for IV-like estimands
propensity

Estimating propensity scores
genWeight

Generating list of target weight functions
wate1

Target weight for ATE
watt1

Target weight for ATT
sOls3

IV-like weighting function, OLS specification 3
sOlsSplines

IV-like weighting function, OLS specifications
vecextract

Auxiliary function: extracting elements from strings
vignetteResult

Vignette results
gendist3e

Generate test distribution 3 with errors
gmmEstimate

Two-step GMM estimate of TE under point identification
groupby

Auxiliary function: grouping rows in data
gendistCovariates

Generate test data set with covariates
permute

Auxiliary function: generate all permutations of a vector
gendistMosquito

Generate mosquito data set
permuteN

Auxiliary function: generate all permutation orderings
sOls1d

IV-like weighting function, OLS specification 1
ivEstimate

Obtaining IV-like specifications
sOls2d

IV-like weighting function, OLS specification 2
removeSplines

Separating splines from MTR formulas
ivmteEstimate

Single iteration of estimation procedure from Mogstad, Torgovitsky, Santos (2018)
l

Listing subsets and components
restring

Auxiliary function that converts an expression of variable names into a vector of strings.
piv

Obtaining IV-like estimands
polyProduct

Function to multiply polynomials
runCplexAPI

Running cplexAPI LP solver
stackA

Stacking monotonicity constraint matrices and vectors
subsetclean

Auxiliary function: remove extraneous spaces
runLpSolveAPI

Running lpSolveAPI
sTsls

IV-like weighting function, TSLS specification
tukeydist

Obtain Tukey half-space quantiles
sTslsSplines

IV-like weighting function, TSLS specification
uSplineBasis

Spline basis function
sWald

IV-like weighting function, Wald specification
symat

Generate symmetric matrix
tsls

TSLS weights, with controls
splineInt

Integrating splines
watu1

Target weight for ATU
weights

Generating splines weights
uSplineInt

Integrated splines
unstring

Auxiliary function that converts a vector of strings into an expression containing variable names.
wlate1

Target weight for LATE
boundCI

Construct confidence intervals for treatment effects under partial identification
alldup

Auxiliary function: determine duplicates
altDefSplinesBasis

(Alternative) Defining single splines basis functions, with interactions
classFormula

Auxiliary function: test if object is a formula
classList

Auxiliary function: test if object is a list
bX

Spline basis function of order 1
bound

Obtaining TE bounds
argstring

Auxiliary function: extract arguments from function in string form
audit

Audit procedure