Description Usage Arguments Value Examples
View source: R/group.proportion.R
Collect point estimate, standard error and 90
the proportion of sizes of the groups defined by gp.var
.
1 | group.proportion(x, gp.var, result.name = "Pct.", drop.na.group = TRUE)
|
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 |
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
.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.