Learn R Programming

tidycomm (version 0.0.1)

crosstab: Crosstab variables

Description

Computes contigency table for one independent (column) variable and one or more dependent (row) variables.

Usage

crosstab(data, col_var, ..., add_total = FALSE, percentages = FALSE,
  chi_square = FALSE)

Arguments

data
col_var

Independent (column) variable.

...

Dependent (row) variables.

add_total

Logical indicating whether a 'Total' column should be computed. Defaults to FALSE.

percentages

Logical indicating whether to output column-wise percentages instead of absolute values. Defaults to FALSE.

chi_square

Logical indicating whether a Chi-square test should be computed. Test results will be reported via message(). Defaults to FALSE.

Value

a tibble

See Also

Other categorical: cramer_V, tab_frequencies

Examples

Run this code
# NOT RUN {
WoJ %>% crosstab(reach, employment)
WoJ %>% crosstab(reach, employment, add_total = TRUE, percentages = TRUE, chi_square = TRUE)

# }

Run the code above in your browser using DataLab