nopodec_mean: Estimates y averages for the two groups, in and out the...

View source: R/nopodec_mean.R

nopodec_meanR Documentation

Estimates y averages for the two groups, in and out the common support. In the common support, counterfactual average y are estimated. It also estimates the number of individuals of the two groups.

Description

The results are all the components necessary to perform a decomposition of the average wage difference between two groups, in four components (as in Nopo (2004)).

Usage

nopodec_mean(...)

## Default S3 method:
nopodec_mean(.reweight_strata_all, y = NULL, weights = NULL, ...)

## S3 method for class 'reweighted'
nopodec_mean(.reweighted, ...)

Arguments

...

arguments passed to or from other methods.

.reweight_strata_all

output of reweight_strata_all2

y

name of the outcome variable for which you want to make the decomposition. If NULL (default), the value is inherited from the attributes of .reweight_strata_all

weights

name of the weight variable (sample weights). If NULL (default), the value is inherited from the attributes of .reweight_strata_all.

.reweighted

an object of class reweighted (the output of reweight_strata_all4)

Value

A data frame with two, three or four rows, with the following columns:

  • the name of the treatment column used in reweight_strata_all2;

  • common_support logical indicating if in or out the common support;

  • ybar average of the y variable, weighted by the given weights;

  • ybar_C_A counterfactual average y of group A as if they had the same distribution of characteristics of group B. This is computed in the common support only and for group A individuals. It is computed with the weights w_AB that result from reweight_strata_all2;

  • ybar_C_B counterfactual average y of group B as if they had the same distribution of characteristics of group A. This is computed in the common support only and for group B individuals. It is computed with the weights w_BA that result from reweight_strata_all2;

  • Nhat estimate of the number of individuals.

The number of rows is given by the combinations of the distinct values of the first two columns: treatment and common_support. In the "typical" case, the resulting data frame will have 4 rows. It can have three rows if all the individuals of one group are in the common support. In case of no common support or no out-of-support, the data frame will have two rows.

Examples

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

nopodec_mean(r00)

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)

nopodec_mean(r00)


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