reweight_strata_all4 | R Documentation |
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).
reweight_strata_all4(data, treatment, variables, y, weights = NULL)
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 |
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 |
.reweight_strata |
adjustment factors to estimate counterfactuals (in the common support). This is the output of |
.reweight_strata_all |
data joined with the estimated adjustment (counterfactual) weights in the common support. This is the output of |
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.