group.proportion: Compute proportion of group sizes on grouped ACS PUMS data.

Description Usage Arguments Value Examples

View source: R/group.proportion.R

Description

Collect point estimate, standard error and 90 the proportion of sizes of the groups defined by gp.var.

Usage

1
group.proportion(x, gp.var, result.name = "Pct.", drop.na.group = TRUE)

Arguments

x

a data frame of PUMS data. If x is already grouped, then this function optionally adds a level to the grouping.

gp.var

name of variable in x to group data by (string) or NULL if x is grouped and you do not want to add a level of grouping. May not be NULL if x is not grouped.

result.name

name of estimate column in result Default is "Pct.".

drop.na.group

drop the group where gp.var is NA

Value

data frame of proportion, standard error of the proportion, and the margin of error of the proportion of the sizes of the groups defined by gp.var.

Examples

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

# Same example using data grouped with group_by
library(dplyr)
gp <- group_by(wa.house16, TEN)
group.proportion(gp, NULL)

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