strat: Stratification index.

Description Usage Arguments Value References Examples

View source: R/strat.R

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

1
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

1
2
3
4
5
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)

Example output

overall stratification:

    strat std_error 
  0.41275   0.01296 

decomposition by education:

                  weight  strat
within education  0.2435 0.2684
between education 0.7565 0.4592
            strata  share s_prank
1  upper nonmanual 0.4344  0.6390
2  lower nonmanual 0.1190  0.4759
3   skilled manual 0.1605  0.4298
4 unskilled manual 0.2862  0.3385
         education weight  strat
1     less than HS 0.0188 0.2072
2 HS or equivalent 0.3707 0.2691
3     some college 0.2794 0.1946
4      BA or above 0.3312 0.3333

strat documentation built on May 2, 2019, 1:45 p.m.

Related to strat in strat...