double_ML: Post double selection.

Description Usage Arguments Details Value Examples

View source: R/double_ML.R

Description

Provides a convenient function to calculate the double ML estimated debiased treatment effect θ.

Usage

1
2
3
double_ML(X, Y, W, method = c("glmnet", "randomforest", "nn", "ols",
  "custom"), show.progress = TRUE, specify.own = NULL, k.fld = 2,
  simulations = 100, validate.inputs = TRUE, seed.use = 1071, ...)

Arguments

X

A matrix of covariates (must be all numeric)

Y

A vector of the target variable, of same length as the number of rows of Y, must be numeric

W

A vector of the treatment variable, of same length as the number of rows of X, must be numeric

method

A selection of methods to use when doing post double selection.

show.progress

Whether to display the simulation progress, defaults to TRUE.

specify.own

Allows the user to supply the method to calculate \hat{W} and \hat{Y}, please refer to custom_helper

k.fld

How many fold crossfitting to use, defaults to 2.

simulations

How many simulations to use for the final result.

validate.inputs

A safety measure indicating whether the types of inputs should be checked, defaults to TRUE (disabled for custom methods).

seed.use

The seed to use for simulations, defaults to 1071.

...

Other arguments to be passed on, see rf_helper, glmnet_helper and ols_helper for details.

Details

Custom functions are currently implemented through a function called custom_generator. For these custom functions, refer to that function and usage examples.

Value

An object of class "ML_Treatment_Effects" that can be further manipulated (ie there is a plot method implemented).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  n = 2000; p = 10
  X = matrix(rnorm(n*p), n, p)
  W = rbinom(n, 1, 0.4 + 0.2 * (X[,1] > 0))
  Y = pmax(X[,1], 0) * W + X[,2] + pmin(X[,3], 0) + rnorm(n)

double_ML(X, Y, W, method = "glmnet",
              k.fld = 2, simulations = 5,
              lambda.set.Y = 1,
              lambda.set.W = 1,
               Z.trans = F)

postDoubleR documentation built on Oct. 7, 2019, 5:05 p.m.