margin_mean | R Documentation |
Estimates average y for groups A and B (marginals) and the number of observations.
margin_mean(...)
## Default S3 method:
margin_mean(.reweight_strata_all, y = NULL, weights = NULL, ...)
## S3 method for class 'reweighted'
margin_mean(.reweighted, ...)
... |
arguments passed to or from other methods. |
.reweight_strata_all |
output of |
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 |
weights |
name of the weight variable (sample weights). If NULL (default), the value is inherited from the attributes of |
.reweighted |
an object of class |
a data frame with two rows (one for each group) and the follwing three columns:
the name of the treatment column used in reweight_strata_all2
;
ybar
: average of the y variable;
Nhat
: estimate of the number of individuals.
data(invented_wages)
r00 <- reweight_strata_all2(invented_wages, treatment = "gender",
variables = c("sector", "education"),
y = "wage", weights = "sample_weights")
margin_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)
margin_mean(r00)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.