moe_topline: weighted topline with margin of error

View source: R/moeTopline.R

moe_toplineR Documentation

weighted topline with margin of error

Description

moe_topline returns a tibble containing a weighted topline of one variable with margin of error

Usage

moe_topline(
  df,
  variable,
  weight,
  remove = c(""),
  n = TRUE,
  pct = TRUE,
  valid_pct = TRUE,
  cum_pct = TRUE,
  zscore = 1.96
)

Arguments

df

The data source

variable

the variable name

weight

The weighting variable, defaults to zwave_weight

remove

An optional character vector of values to remove from final table (e.g. "refused"). This will not affect any calculations made. The vector is not case-sensitive.

n

logical, if TRUE a frequency column is included percentages, but in a separate row for column percentages.

pct

logical, if TRUE a column of percents is included

valid_pct

logical, if TRUE a column of valid percents is included

cum_pct

logical, if TRUE a column of cumulative percents is included

zscore

defaults to 1.96, consistent with a 95% confidence interval

Details

By default the table includes a column for frequency count, percent, valid percent, and cumulative percent.

Value

a tibble

Examples

moe_topline(df = illinois, variable = educ6, weight = weight)
moe_topline(df = illinois, variable = educ6, weight = weight, remove = c("LT HS"))

pollster documentation built on May 31, 2023, 7:39 p.m.