View source: R/reweight_strata.R
reweight_strata2 | R Documentation |
Adjustment factors are used to reweight the joint distribution of characteristics of one group so that it will be equal to that of the other group (both counterfacuals, AB and BA...). This will be done on the common support only.
reweight_strata2(.fhat_strata)
.fhat_strata |
output of |
a data frame with the strata
in the common support (in the rows), the reweighting factors rw_BA
and rw_AB
(see below), and joint frequencies of the strata in the two groups (f_A
and f_B
).
Details about the columns of the returned data frame:
strata |
Unique combinations of the modalities of the variables used in |
rw_BA |
This is the reweighting factor which has to be given to group B
such that the distribution of their characteristics will be the same as that
of group A. This is computed, in each |
rw_AB |
This is the reweighting factor which has to be given to group A such that the distribution of their characteristics will be the same as that of group B. This is computed, in each |
f_A |
estimated frequencies of |
f_B |
estimated frequencies of |
fhat_strata2
, whose result is the input of this function.
See reweight_strata_all2
, that uses internally functions
common_support_strata2
, fhat_strata2
and reweight_strata2
.
data(invented_wages)
c00 <- common_support_strata2(invented_wages, treatment = "gender",
variables = c("sector", "education"),
y = "wage", weights = "sample_weights")
f00 <- fhat_strata2(c00)
reweight_strata2(f00)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.