reweight_strata_all2: Estimates adjustment (counterfactual) weights in the common...

View source: R/reweight_strata_all.R

reweight_strata_all2R Documentation

Estimates adjustment (counterfactual) weights in the common support and joins with the data. For observations out of the common support, the weights are equal to the sample weights (or one, in case of absence of sample weights).

Description

Estimates adjustment (counterfactual) weights in the common support and joins with the data. For observations out of the common support, the weights are equal to the sample weights (or one, in case of absence of sample weights).

Usage

reweight_strata_all2(data, treatment, variables, y, weights = NULL)

Arguments

data

data frame

treatment

column name of the binary variable

variables

character vector of the variables' names, for which the common support has to be established

y

name of the outcome variable for which you want to make the decomposition

weights

name of the weight variable (sample weights). If NULL (default value) it uses equal weights for all observations, adding a column of ones

Value

a data frame with the same number of rows of the starting data, with columns of the chosen treatment, variables, y, weights, common_support (TRUE or FALSE), strata (a strata is given by a certain combination of the modalities of the variables), adjustment factors (rw_BA and rw_AB), empirical joint frequencies of strata in the two groups (f_A and f_B) and adjustment weights (w_BA and w_AB), which have to be used to perform (wage) decompositions

See Also

common_support_strata2, fhat_strata2 and reweight_strata2, that are used internally by this function. For the next steps, see for example nopodec_mean, dec_median and dec_quantile. See also margin_mean and margin_quantile, that use the output of this function as their input. This function is also used in reweight_strata_all4, whose result is an object of class reweighted, that is a list with 3 components: the output of fhat_strata2 (.fhat_strata), reweight_strata2 (.reweight_strata) and reweight_strata_all2 (.reweight_strata_all).

Examples

data(invented_wages)
reweight_strata_all2(invented_wages, treatment = "gender",
                       variables = c("sector", "education"),
                       y = "wage", weights = "sample_weights")


gibonet/decr documentation built on Jan. 5, 2024, 7:26 a.m.