crosstab | R Documentation |
Computes contingency table for one independent (column) variable and one or more dependent (row) variables.
crosstab(
data,
col_var,
...,
add_total = FALSE,
percentages = FALSE,
chi_square = FALSE
)
data |
a tibble or a tdcmm model |
col_var |
Independent (column) variable. |
... |
Dependent (row) variables. |
add_total |
Logical indicating whether a 'Total' column should be
computed. Defaults to |
percentages |
Logical indicating whether to output column-wise
percentages instead of absolute values. Defaults to |
chi_square |
Logical indicating whether a Chi-square test should be computed.
Test results will be reported via message(). Defaults to |
a tdcmm model
Other categorical:
tab_frequencies()
WoJ %>% crosstab(reach, employment)
WoJ %>% crosstab(reach, employment, add_total = TRUE, percentages = TRUE, chi_square = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.