strat {strat} | R Documentation |
Stratification index.
Description
strat
computes the stratification index proposed in Zhou (2012). When
group
is specified, it also returns between-group and within-group
components of the overall stratification.
Usage
strat(outcome, strata, weights = NULL, ordered = FALSE, group = NULL)
Arguments
outcome |
A numeric vector of outcome. |
strata |
A vector of |
weights |
An optional vector of weights. |
ordered |
Logical. If |
group |
An optional grouping factor. If specified, |
Value
An object of class strat
.
overall |
a vector of two, giving computed stratification index and approximate standard error. |
strata_info |
a data frame of stratum-specific information, including name, population share, and average percentile rank. |
decomposition |
between-group and within-group components of the overall stratification. |
within_group |
within-group indices of stratification by group. |
References
Zhou, Xiang. 2012. "A Nonparametric Index of Stratification." Sociological Methodology, 42(1): 365-389.
Examples
s <- with(cpsmarch2015, strat(income, big_class,
weights = weight, group = education))
print(s, digits = 4)
print(s$strata_info, digits = 4)
print(s$within_group, digits = 4)