Abstract base class that can't be initialized.

## Format

R6::R6Class object.

Other DoubleML: DoubleMLIIVM, DoubleMLIRM, DoubleMLPLIV, DoubleMLPLR

## Active bindings

all_coef

(matrix())
Estimates of the causal parameter(s) for the n_rep different sample splits after calling fit().

all_dml1_coef

(array())
Estimates of the causal parameter(s) for the n_rep different sample splits after calling fit() with dml_procedure = "dml1".

all_se

(matrix())
Standard errors of the causal parameter(s) for the n_rep different sample splits after calling fit().

apply_cross_fitting

(logical(1))
Indicates whether cross-fitting should be applied. Default is TRUE.

boot_coef

(matrix())
Bootstrapped coefficients for the causal parameter(s) after calling fit() and bootstrap().

boot_t_stat

(matrix())
Bootstrapped t-statistics for the causal parameter(s) after calling fit() and bootstrap().

coef

(numeric())
Estimates for the causal parameter(s) after calling fit().

data

(data.table)
Data object.

dml_procedure

(character(1))
A character() ("dml1" or "dml2") specifying the double machine learning algorithm. Default is "dml2".

draw_sample_splitting

(logical(1))
Indicates whether the sample splitting should be drawn during initialization of the object. Default is TRUE.

learner

(named list())
The machine learners for the nuisance functions.

n_folds

(integer(1))
Number of folds. Default is 5.

n_rep

(integer(1))
Number of repetitions for the sample splitting. Default is 1.

params

(named list())
The hyperparameters of the learners.

psi

(array())
Value of the score function $$\psi(W;\theta, \eta)=\psi_a(W;\eta) \theta + \psi_b (W; \eta)$$ after calling fit().

psi_a

(array())
Value of the score function component $$\psi_a(W;\eta)$$ after calling fit().

psi_b

(array())
Value of the score function component $$\psi_b(W;\eta)$$ after calling fit().

predictions

(array())
Predictions of the nuisance models after calling fit(store_predictions=TRUE).

pval

(numeric())
p-values for the causal parameter(s) after calling fit().

score

(character(1), function())
A character(1) or function() specifying the score function.

se

(numeric())
Standard errors for the causal parameter(s) after calling fit().

smpls

(list())
The partition used for cross-fitting.

smpls_cluster

(list())
The partition of clusters used for cross-fitting.

t_stat

(numeric())
t-statistics for the causal parameter(s) after calling fit().

tuning_res

(named list())
Results from hyperparameter tuning.

## Methods

### Method new()

DoubleML is an abstract class that can't be initialized.

### Method fit()

Estimate DoubleML models.

#### Arguments

method

(character(1))
A character(1) ("Bayes", "normal" or "wild") specifying the multiplier bootstrap method.

n_rep_boot

(integer(1))
The number of bootstrap replications.

self

### Method split_samples()

Draw sample splitting for DoubleML models.

The samples are drawn according to the attributes n_folds, n_rep and apply_cross_fitting.

#### Arguments

smpls

(list())
A nested list(). The outer lists needs to provide an entry per repeated sample splitting (length of the list is set as n_rep). The inner list is a named list() with names train_ids and test_ids. The entries in train_ids and test_ids must be partitions per fold (length of train_ids and test_ids is set as n_folds).

self

#### Examples

library(DoubleML)
library(mlr3)
set.seed(2)
obj_dml_data = make_plr_CCDDHNR2018(n_obs=10)
dml_plr_obj = DoubleMLPLR$new(obj_dml_data, lrn("regr.rpart"), lrn("regr.rpart")) # simple sample splitting with two folds and without cross-fitting smpls = list(list(train_ids = list(c(1, 2, 3, 4, 5)), test_ids = list(c(6, 7, 8, 9, 10)))) dml_plr_obj$set_sample_splitting(smpls)

# sample splitting with two folds and cross-fitting but no repeated cross-fitting
smpls = list(list(train_ids = list(c(1, 2, 3, 4, 5), c(6, 7, 8, 9, 10)),
test_ids = list(c(6, 7, 8, 9, 10), c(1, 2, 3, 4, 5))))
dml_plr_obj$set_sample_splitting(smpls) # sample splitting with two folds and repeated cross-fitting with n_rep = 2 smpls = list(list(train_ids = list(c(1, 2, 3, 4, 5), c(6, 7, 8, 9, 10)), test_ids = list(c(6, 7, 8, 9, 10), c(1, 2, 3, 4, 5))), list(train_ids = list(c(1, 3, 5, 7, 9), c(2, 4, 6, 8, 10)), test_ids = list(c(2, 4, 6, 8, 10), c(1, 3, 5, 7, 9)))) dml_plr_obj$set_sample_splitting(smpls)


### Method tune()

Hyperparameter-tuning for DoubleML models.

The hyperparameter-tuning is performed using the tuning methods provided in the mlr3tuning package. For more information on tuning in mlr3, we refer to the section on parameter tuning in the mlr3 book.

#### Arguments

digits

(integer(1))
The number of significant digits to use when printing.

### Method confint()

Confidence intervals for DoubleML models.

#### Returns

character() with names of learners.

### Method params_names()

Returns the names of the nuisance models with hyperparameters.

DoubleML$params_names() #### Returns character() with names of nuisance models with hyperparameters. ### Method set_ml_nuisance_params() Set hyperparameters for the nuisance models of DoubleML models. Note that in the current implementation, either all parameters have to be set globally or all parameters have to be provided fold-specific. #### Usage DoubleML$set_ml_nuisance_params(
learner = NULL,
treat_var = NULL,
params,
set_fold_specific = FALSE
)

#### Arguments

learner

(character(1))
The nuisance model/learner (see method params_names).

treat_var

(character(1))
The treatment varaible (hyperparameters can be set treatment-variable specific).

params

(named list())
A named list() with estimator parameters. Parameters are used for all folds by default. Alternatively, parameters can be passed in a fold-specific way if option fold_specificis TRUE. In this case, the outer list needs to be of length n_rep and the inner list of length n_folds.

set_fold_specific

(logical(1))
Indicates if the parameters passed in params should be passed in fold-specific way. Default is FALSE. If TRUE, the outer list needs to be of length n_rep and the inner list of length n_folds. Note that in the current implementation, either all parameters have to be set globally or all parameters have to be provided fold-specific.

self

### Method p_adjust()

Multiple testing adjustment for DoubleML models.

#### Arguments

learner

(character(1))
The nuisance model/learner (see method params_names())

#### Returns

named list()with paramers for the nuisance model/learner.

### Method clone()

The objects of this class are cloneable with this method.

DoubleML$clone(deep = FALSE) #### Arguments deep Whether to make a deep clone. ## Examples  ## ------------------------------------------------ ## Method DoubleML$set_sample_splitting
## ------------------------------------------------

library(DoubleML)
library(mlr3)
set.seed(2)
obj_dml_data = make_plr_CCDDHNR2018(n_obs=10)
dml_plr_obj = DoubleMLPLR$new(obj_dml_data, lrn("regr.rpart"), lrn("regr.rpart")) # simple sample splitting with two folds and without cross-fitting smpls = list(list(train_ids = list(c(1, 2, 3, 4, 5)), test_ids = list(c(6, 7, 8, 9, 10)))) dml_plr_obj$set_sample_splitting(smpls)

# sample splitting with two folds and cross-fitting but no repeated cross-fitting
smpls = list(list(train_ids = list(c(1, 2, 3, 4, 5), c(6, 7, 8, 9, 10)),
test_ids = list(c(6, 7, 8, 9, 10), c(1, 2, 3, 4, 5))))
dml_plr_obj$set_sample_splitting(smpls) # sample splitting with two folds and repeated cross-fitting with n_rep = 2 smpls = list(list(train_ids = list(c(1, 2, 3, 4, 5), c(6, 7, 8, 9, 10)), test_ids = list(c(6, 7, 8, 9, 10), c(1, 2, 3, 4, 5))), list(train_ids = list(c(1, 3, 5, 7, 9), c(2, 4, 6, 8, 10)), test_ids = list(c(2, 4, 6, 8, 10), c(1, 3, 5, 7, 9)))) dml_plr_obj$set_sample_splitting(smpls)