Package: ivmte 1.4.0

ivmte: Instrumental Variables: Extrapolation by Marginal Treatment Effects

The marginal treatment effect was introduced by Heckman and Vytlacil (2005) <doi:10.1111/j.1468-0262.2005.00594.x> to provide a choice-theoretic interpretation to instrumental variables models that maintain the monotonicity condition of Imbens and Angrist (1994) <doi:10.2307/2951620>. This interpretation can be used to extrapolate from the compliers to estimate treatment effects for other subpopulations. This package provides a flexible set of methods for conducting this extrapolation. It allows for parametric or nonparametric sieve estimation, and allows the user to maintain shape restrictions such as monotonicity. The package operates in the general framework developed by Mogstad, Santos and Torgovitsky (2018) <doi:10.3982/ECTA15463>, and accommodates either point identification or partial identification (bounds). In the partially identified case, bounds are computed using either linear programming or quadratically constrained quadratic programming. Support for four solvers is provided. Gurobi and the Gurobi R API can be obtained from <http://www.gurobi.com/index>. CPLEX can be obtained from <https://www.ibm.com/analytics/cplex-optimizer>. CPLEX R APIs 'Rcplex' and 'cplexAPI' are available from CRAN. MOSEK and the MOSEK R API can be obtained from <https://www.mosek.com/>. The lp_solve library is freely available from <http://lpsolve.sourceforge.net/5.5/>, and is included when installing its API 'lpSolveAPI', which is available from CRAN.

Authors:Alexander Torgovitsky [aut], Joshua Shea [aut, cre]

ivmte_1.4.0.tar.gz
ivmte_1.4.0.zip(r-4.5)ivmte_1.4.0.zip(r-4.4)ivmte_1.4.0.zip(r-4.3)
ivmte_1.4.0.tgz(r-4.4-any)ivmte_1.4.0.tgz(r-4.3-any)
ivmte_1.4.0.tar.gz(r-4.5-noble)ivmte_1.4.0.tar.gz(r-4.4-noble)
ivmte_1.4.0.tgz(r-4.4-emscripten)ivmte_1.4.0.tgz(r-4.3-emscripten)
ivmte.pdf |ivmte.html
ivmte/json (API)

# Install 'ivmte' in R:
install.packages('ivmte', repos = c('https://jkcshea.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/jkcshea/ivmte/issues

Datasets:

On CRAN:

30 exports 18 stars 2.19 score 1 dependencies 27 scripts 285 downloads

Last updated 22 days agofrom:5265ecdda0. Checks:ERROR: 7. Indexed: yes.

TargetResultDate
Doc / VignettesFAILAug 27 2024
R-4.5-winERRORAug 27 2024
R-4.5-linuxERRORAug 27 2024
R-4.4-winERRORAug 27 2024
R-4.4-macERRORAug 27 2024
R-4.3-winERRORAug 27 2024
R-4.3-macERRORAug 27 2024

Exports:auditboundcriterionMindesigngenGammagenSSetgenTargetgmmEstimateinteractSplinesivEstimateivmtellpSetuplpSetupBoundlpSetupCriterionlpSetupCriterionBootlpSetupInfeasiblelpSetupSolveroptionsCplexAPIoptionsGurobioptionsLpSolveAPIoptionsRmosekpolyparsepropensityqpSetupqpSetupBoundqpSetupCriterionqpSetupInfeasibleremoveSplinesrhalton

Dependencies:Formula

Readme and manuals

Help Manual

Help pageTopics
Angrist Evans DataAE
(Alternative) Defining single splines basis functions, with interactionsaltDefSplinesBasis
Auxiliary function: extract arguments from function in string formargstring
Audit procedureaudit
Obtaining TE boundsbound
Construct confidence intervals for treatment effects under partial identificationboundCI
Construct p-values for treatment effects under partial identificationboundPvalue
Spline basis function of order 1bX
Check polynomial form of the u-termcheckU
Auxiliary function: test if object is a formulaclassFormula
Auxiliary function: test if object is a listclassList
Combining the boundedness and monotonicity constraint objectscombinemonobound
Construct constant functionconstructConstant
Minimizing violation of observational equivalencecriterionMin
Generating design matricesdesign
Auxiliary function: extracting columns by component namesextractcols
Format result for displayfmtResult
Evaluate a particular functionfunEval
Generate basis matrix for splinesgenBasisSplines
Generating the constraint matrixgenboundA
Generate test distribution 1gendist1
Generate test distribution 1 with errorsgendist1e
Generate test distribution 2gendist2
Generate test distribution 3gendist3
Generate test distribution 3 with errorsgendist3e
Generate test distribution 4gendist4
Generate test distribution 5 (has errors and a covariate)gendist5e
Generate test distribution 6 (has errors and a covariate)gendist6e
Generate basic data set for testinggendistBasic
Generate test data set with covariatesgendistCovariates
Generate mosquito data setgendistMosquito
Generate test data set with splinesgendistSplines
Auxiliary function: generating basis vectorsgenej
Estimating expectations of terms in the MTR (gamma objects)genGamma
Generate Gamma moments for splinesgenGammaSplines
Generating the Gamma moments for splines, for 'testthat'genGammaSplinesTT
Function to generate gamma moments for 'testthat'genGammaTT
Generating the grid for the audit proceduregengrid
Generate components of the monotonicity constraintsgenmonoA
Generating monotonicity and boundedness constraintsgenmonoboundA
Generating moments/data for IV-like estimandsgenSSet
Generating target MTR momentsgenTarget
Generating list of target weight functionsgenWeight
Auxiliary function: extract X and Z covariates from a formulagetXZ
GMM estimate of TE under point identificationgmmEstimate
Update splines object with list of interactionsinteractSplines
Auxiliary function: check if string is commandisfunctionstring
Obtaining IV-like specificationsivEstimate
Instrumental Variables: Extrapolation by Marginal Treatment Effectsivmte
Single iteration of estimation procedure from Mogstad, Torgovitsky, Santos (2018)ivmteEstimate
ivmte Simulated DataivmteSimData
Listing subsets and componentsl
Constructing LP problemlpSetup
Configure LP environment for obtaining the boundslpSetupBound
Configure LP environment for minimizing the criterionlpSetupCriterion
Configure LP environment for specification testinglpSetupCriterionBoot
Generate equality constraintslpSetupEqualCoef
Configure LP environment for diagnosticslpSetupInfeasible
Configure LP environment to be compatible with solverslpSetupSolver
Check magnitude of real numbermagnitude
Convert matrix into triplet formmatrixTriplets
Function to generate integral of m0 and m1mInt
Auxiliary function: modifying callsmodcall
Construct pre-meaned moment matrixmomentMatrix
Integrating and evaluating monomialsmonoIntegral
Check if custom weights are negations of each othernegationCheck
OLS weightsolsj
Function to parse options for CPLEXoptionsCplexAPI
Function to parse a single set of options for CPLEXoptionsCplexAPISingle
Function to extract feasibility tolerance from CPLEX optionsoptionsCplexAPITol
Function to parse options for GurobioptionsGurobi
Function to parse options for lp_solveoptionsLpSolveAPI
Function to parse options for GurobioptionsRmosek
Correct boolean expressions in terms listsparenthBoolean
Auxiliary function: generate all permutations of a vectorpermute
Auxiliary function: generate all permutation orderingspermuteN
Obtaining IV-like estimandspiv
Parsing marginal treatment response formulaspolyparse
Function to multiply polynomialspolyProduct
Calulating population meanpopmean
Print resultsprint.ivmte
Estimating propensity scorespropensity
Constructing QCQP problemqpSetup
Constructing QCQP problem for boundingqpSetupBound
Configure QCQP problem to find minimum criterionqpSetupCriterion
Configure QP environment for diagnosticsqpSetupInfeasible
Separating splines from MTR formulasremoveSplines
Function to implement rescaling procedurerescaleX
Auxiliary function that converts an expression of variable names into a vector of strings.restring
Generate Halton sequencerhalton
Running cplexAPI solverrunCplexAPI
Running Gurobi solverrunGurobi
Running lpSolveAPIrunLpSolveAPI
Running RmosekrunMosek
Select points from audit grid to add to the constraint gridselectViolations
IV-like weighting function, OLS specification 1sOls1d
IV-like weighting function, OLS specification 2sOls2d
IV-like weighting function, OLS specification 3sOls3
IV-like weighting function, OLS specificationssOlsSplines
Integrating splinessplineInt
Evaluating splines basis functionssplinesBasis
Constructing higher order splinessplineUpdate
Convert status code to stringstatusString
IV-like weighting function, TSLS specificationsTsls
IV-like weighting function, TSLS specificationsTslsSplines
Auxiliary function: remove extraneous spacessubsetclean
Summarize resultssummary.ivmte
IV-like weighting function, Wald specificationsWald
Generate symmetric matrixsymat
TSLS weights, with controlstsls
Auxiliary function that converts a vector of strings into an expression containing variable names.unstring
Spline basis functionuSplineBasis
Integrated splinesuSplineInt
Auxiliary function: extracting elements from stringsvecextract
Target weight for ATEwate1
Target weight for ATTwatt1
Target weighting function, for ATTwAttSplines
Target weight for ATUwatu1
Generating splines weightsweights
Target weight for generalized LATEwgenlate1
Auxiliary function: 'which' for listswhichforlist
Target weight for LATEwlate1