MCATE_cfg is a configuration class for estimating marginal response surfaces based on heterogeneous treatment effect estimates. "Marginal" in this context implies that all other covariates are marginalized. Thus, if two covariates are highly correlated, it is likely that their MCATE surfaces will be extremely similar.

Public fields

cfgs

Named list of covariates names to a Model_cfg object defining how to present that covariate's CATE surface (while marginalizing over all other covariates).

std_errors

Boolean indicating whether the results should be returned with standard errors or not.

estimand

String indicating the estimand to target.

Methods


Method new()

Create a new MCATE_cfg object with specified model name and hyperparameters.

Usage

MCATE_cfg$new(cfgs, std_errors = TRUE)

Arguments

cfgs

Named list from moderator name to a Model_cfg object defining how to present that covariate's CATE surface (while marginalizing over all other covariates)

std_errors

Boolean indicating whether the results should be returned with standard errors or not.

Returns

A new MCATE_cfg object.

Examples

MCATE_cfg$new(cfgs = list(x1 = KernelSmooth_cfg$new(neval = 100)))


Method add_moderator()

Add a moderator to the MCATE_cfg object. This entails defining a configuration for displaying the effect surface for that moderator.

Usage

MCATE_cfg$add_moderator(var_name, cfg)

Arguments

var_name

The name of the moderator to add (and the name of the column in the dataset).

cfg

A Model_cfg defining how to display the selected moderator's effect surface.

Returns

An updated MCATE_cfg object.

Examples

cfg <- MCATE_cfg$new(cfgs = list(x1 = KernelSmooth_cfg$new(neval = 100)))
cfg <- cfg$add_moderator("x2", KernelSmooth_cfg$new(neval = 100))


Method clone()

The objects of this class are cloneable with this method.

Usage

MCATE_cfg$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

MCATE_cfg$new(cfgs = list(x1 = KernelSmooth_cfg$new(neval = 100)))
#> <MCATE_cfg>
#>   Public:
#>     add_moderator: function (var_name, cfg) 
#>     cfgs: list
#>     clone: function (deep = FALSE) 
#>     estimand: MCATE
#>     initialize: function (cfgs, std_errors = TRUE) 
#>     std_errors: TRUE

## ------------------------------------------------
## Method `MCATE_cfg$new`
## ------------------------------------------------

MCATE_cfg$new(cfgs = list(x1 = KernelSmooth_cfg$new(neval = 100)))
#> <MCATE_cfg>
#>   Public:
#>     add_moderator: function (var_name, cfg) 
#>     cfgs: list
#>     clone: function (deep = FALSE) 
#>     estimand: MCATE
#>     initialize: function (cfgs, std_errors = TRUE) 
#>     std_errors: TRUE

## ------------------------------------------------
## Method `MCATE_cfg$add_moderator`
## ------------------------------------------------

cfg <- MCATE_cfg$new(cfgs = list(x1 = KernelSmooth_cfg$new(neval = 100)))
cfg <- cfg$add_moderator("x2", KernelSmooth_cfg$new(neval = 100))