setup_diff: Setup function for 'diff' arguments

View source: R/initializers.R

setup_diffR Documentation

Setup function for diff arguments

Description

This setup function controls how differences of generic target parameters are taken. Returns a list with two components, called subtract_from and subtracted. The first element (subtract_from) denotes what shall be the base group to subtract from in the generic targets of interest (GATES or CLAN); either "most" or "least". The second element (subtracted) are the groups to be subtracted from subtract_from, which is a subset of {1,2,...,K}, where K equals the number of groups. The number of groups should be consistent with the number of groups induced by the argument quantile_cutoffs, which is the cardinality of quantile_cutoffs, plus one.

Usage

setup_diff(subtract_from = "most", subtracted = 1)

Arguments

subtract_from

String indicating the base group to subtract from, either "most" (default) or "least". The most affected group corresponds to the K-th group in the paper (there are K groups). The least affected group corresponds to the first group.

subtracted

Vector indicating the groups to be subtracted from the group specified in subtract_from. If there are K groups, subtracted should be a subset of {1,2,...,K}. Be careful to not specify a zero difference: If subtract_from = "most", subtracting group K results in a zero difference. Same if subtract_from = "least" and we subtract group 1.

Details

The output of this setup function is intended to be used as argument in the functions GenericML() and GenericML_single() (arguments diff_GATES, diff_CLAN), as well as GATES() and CLAN() (argument diff).

Value

An object of class "setup_diff", consisting of the following components:

subtract_from

A character equal to "most" or "least".

subtracted

A numeric vector of group indices.

See the description above for details.

References

Chernozhukov V., Demirer M., Duflo E., Fernández-Val I. (2020). “Generic Machine Learning Inference on Heterogenous Treatment Effects in Randomized Experiments.” arXiv preprint arXiv:1712.04802. URL: https://arxiv.org/abs/1712.04802.

See Also

GenericML(), GenericML_single(), CLAN(), GATES(), setup_X1(), setup_vcov()

Examples

## specify quantile cutoffs (the 4 quartile groups here)
quantile_cutoffs <- c(0.25, 0.5, 0.75)

## Use group difference GK-G1 as generic targets in GATES and CLAN
## Gx is the x-th group
setup_diff(subtract_from = "most", subtracted = 1)

## Use GK-G1, GK-G2, GK-G3 as differenced generic targets
setup_diff(subtract_from = "most", subtracted = c(1,2,3))

## Use G1-G2, G1-G3 as differenced generic targets
setup_diff(subtract_from = "least", subtracted = c(3,2))


GenericML documentation built on June 18, 2022, 9:09 a.m.