crosstab: Make a weighted crosstab of row proportions

Description Usage Arguments Details Value Examples

View source: R/MakeCrosstab.R

Description

crosstab returns a data.frame containing a weighted crosstab of two variables

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
crosstab(
  mulaw,
  x,
  y,
  weight = zwave_weight,
  remove = "",
  n = TRUE,
  pct_type = "row",
  format = "wide",
  ...
)

Arguments

mulaw

The data.frame containing the version of the integrated file you wish to use

x

The independent variable

y

The dependent variable

weight

The weighting variable, defaults to zwave_weight

remove

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

n

logical, if TRUE a column of row totals is included

pct_type

Controls the kind of percentage values returned. One of "row," "cell," or "column."

format

one of "long" or "wide"

...

further arguments passed to pollster::crosstab, such as unwt_n

Details

This is a wrapper around pollster::crosstab()

Value

A tibble

Examples

1
crosstab(mulaw = df, x = zpid3, y = g40v2, remove = c("don't know", "refused"))

jdjohn215/MLSPTools documentation built on Sept. 2, 2020, 1:16 a.m.