group.count: Compute weighted size of groups in ACS PUMS data.

Description Usage Arguments Value Examples

View source: R/group.count.R

Description

Collect point estimate, standard error and 90 the size of the groups defined by gp.var and the whole data.

Usage

1
group.count(x, gp.var, result.name = "Count", drop.na.group = FALSE)

Arguments

x

a data frame of PUMS data

gp.var

name of variable in x to group data by, a string

result.name

name of estimate column in result. Default is 'Count'.

drop.na.group

drop the group where gp.var is NA; default FALSE

Value

data frame of count, standard error of the count, and the margin of error of the count over the groups defined by gp.var and for the whole data.

Examples

1
2
3
4
5
6
7
8
# Count of occupied households by tenure type for Washington State in 2016
group.count(wa.house16, 'TEN')

# Example using data grouped with group_by
library(dplyr)
wa.house16$Size <- clip.column(wa.house16, 'NP', 5)
gp <- group_by(wa.house16, TEN)
group.count(gp, 'Size')

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