R/double_ml_data.R
double_ml_data_from_data_frame.Rd
Initalization of DoubleMLData from data.frame
.
double_ml_data_from_data_frame(
df,
x_cols = NULL,
y_col = NULL,
d_cols = NULL,
z_cols = NULL,
cluster_cols = NULL,
use_other_treat_as_covariate = TRUE
)
(data.frame()
)
Data object.
(NULL
, character()
)
The covariates. If NULL
, all variables (columns of data
) which are
neither specified as outcome variable y_col
, nor as treatment variables
d_cols
, nor as instrumental variables z_cols
are used as covariates.
Default is NULL
.
(character(1)
)
The outcome variable.
(character()
)
The treatment variable(s).
(NULL
, character()
)
The instrumental variables. Default is NULL
.
(NULL
, character()
)
The cluster variables. Default is NULL
.
(logical(1)
)
Indicates whether in the multiple-treatment case the other treatment
variables should be added as covariates. Default is TRUE
.
Creates a new instance of class DoubleMLData
.
df = make_plr_CCDDHNR2018(return_type = "data.frame")
x_names = names(df)[grepl("X", names(df))]
obj_dml_data = double_ml_data_from_data_frame(
df = df, x_cols = x_names,
y_col = "y", d_cols = "d")
# Input: Data frame, Output: DoubleMLData object