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

reweight_strata_all4R Documentation

Estimates adjustment (counterfactual) weights in the common support and joins with the data.

Description

This function 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). Note that this function does the same things of reweight_strata_all2, but stores two intermediate results: the output of functions fhat_strata2 and reweight_strata2 (see the description in the value section).

Usage

reweight_strata_all4(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

An object of class reweighted. This is a list with the following elements:

.fhat_strata

empirical joint frequencies of strata, in and out of the common support. This is the output of fhat_strata2

.reweight_strata

adjustment factors to estimate counterfactuals (in the common support). This is the output of reweight_strata2

.reweight_strata_all

data joined with the estimated adjustment (counterfactual) weights in the common support. This is the output of reweight_strata_all2

See Also

fhat_strata2, reweight_strata2 and reweight_strata_all2, that are the 3 components of the list resulting from this function (an object of class reweighted). 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.

Examples

data(invented_wages)
r00 <- reweight_strata_all4(invented_wages, treatment = "gender",
                       variables = c("sector", "education"),
                       y = "wage", weights = "sample_weights")

str(r00)
names(r00)
class(r00)

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