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 length(outcome) indicating strata membership. The elements are coerced to factors by factor.

weights

An optional vector of weights.

ordered

Logical. If TRUE strata are pre-ordered ascendingly.

group

An optional grouping factor. If specified, strat also returns between-group and within-group components of the overall stratification.

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)

[Package strat version 0.1 Index]