double_ml_data_from_matrix: Wrapper for Double machine learning data-backend...

Description Usage Arguments Value Examples

View source: R/double_ml_data.R

Description

Initalization of DoubleMLData from matrix() objects.

Usage

1
2
3
4
5
6
7
8
9
double_ml_data_from_matrix(
  X = NULL,
  y,
  d,
  z = NULL,
  cluster_vars = NULL,
  data_class = "DoubleMLData",
  use_other_treat_as_covariate = TRUE
)

Arguments

X

(matrix())
Matrix of covariates.

y

(numeric())
Vector of outcome variable.

d

(matrix())
Matrix of treatment variables.

z

(matrix())
Matrix of instruments.

cluster_vars

(matrix())
Matrix of cluster variables.

data_class

(character(1))
Class of returned object. By default, an object of class DoubleMLData is returned. Setting data_class = "data.table" returns an object of class data.table.

use_other_treat_as_covariate

(logical(1))
Indicates whether in the multiple-treatment case the other treatment variables should be added as covariates. Default is TRUE.

Value

Creates a new instance of class DoubleMLData.

Examples

1
2
3
4
5
matrix_list = make_plr_CCDDHNR2018(return_type = "matrix")
obj_dml_data = double_ml_data_from_matrix(
  X = matrix_list$X,
  y = matrix_list$y,
  d = matrix_list$d)

DoubleML documentation built on Oct. 26, 2021, 5:06 p.m.