prop.cond: Estimate proportion of a population in a subset for ACS PUMS...

Description Usage Arguments Value Examples

View source: R/prop.cond.R

Description

Compute the proportion of a population in a subset defined by a list of conditions. The conditions are combined with a logical-and. The conditions should be bare expressions, not strings. This function uses rlang::quos.

Usage

1
prop.cond(x, ..., wt.rep.num = NULL)

Arguments

x

data.frame or similar with data filtered to relevant rows.

...

a list of conditions that define the subset, as bare expressions, not as strings

wt.rep.num

the weight replicate number, if a replicate weight

Value

point estimate of the proportion of population in subset

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Fraction of Washington State households that pay cash rent
prop.cond(wa.house16, TEN==3)

# Fraction of Washington State renter households that have only 1 person.
prop.cond(wa.house16, TEN==3, NP==1)

# Fraction of Washington State households that are rent-burdened renters
# A household is rent-burdened if it pays more than 30% of its income in rent.
# GRNTP is monthly gross rent, HINCP is annual household income
prop.cond(wa.house16, 12 * GRNTP > 0.3 * HINCP)

davidthaler/PUMSutils documentation built on July 13, 2019, 9:58 a.m.