srank: Ranking strata.

Description Usage Arguments Value Examples

View source: R/srank.R

Description

Ranking strata according to the average percentile rank of members in each stratum.

Usage

1
srank(outcome, strata, weights = NULL, 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.

group

An optional grouping factor.

Value

An object of class srank.

raw

a data frame consisting of complete cases of all inputs.

summary

a data frame of stratum-specific information, including name, population share, and average percentile rank.

Examples

1
2
3
strata_info <- with(cpsmarch2015, srank(income, big_class,
 weights = weight, group = education))
print(strata_info, digits = 3)

Example output

            strata share s_prank
1  upper nonmanual 0.434   0.639
2  lower nonmanual 0.119   0.476
3   skilled manual 0.160   0.430
4 unskilled manual 0.286   0.338

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

Related to srank in strat...