compute.counterfactual: compute.counterfactual

View source: R/counterfactual.R

compute.counterfactualR Documentation

compute.counterfactual

Description

The internal code for computing counterfactual distributions

Usage

compute.counterfactual(outcome, wfun1, wfun2, data, tau = seq(0.1, 0.9,
  0.1), numyvals = NULL)

Arguments

outcome

A vector of outcomes

wfun1

A function that takes in 'data' and returns a vector of the same length as 'outcome' that contains the first set of weights

wfun2

A function that takes in 'data' and returns a vector of the same length as 'outcome' that contains the first set of weights

data

A data.frame for which the functions wf1(data) and wf2(data) will be called

tau

The values at which to compute quantile effects, this should be a numeric vector with values strictly between 0 and 1

numyvals

The number of values of the outcome to use in computing counterfactual distributions. The default is to use all of them; it may speed up computation to set this equal to some smaller number (e.g. 100)

Value

A list that contains the difference in average outcomes using each set of weights, the distribution functions using each set of weights, the quantiles (and their difference) using each set of weights, tau, and the sequence of y values used to construct the distributions


bcallaway11/cfIneq documentation built on Sept. 12, 2023, 5:54 a.m.