Skip to contents

Chi squared is calculated using stats::chisq.test. If any cell contains less than 5 observations, the exact-parameter is set.

Usage

effect_counts_one_grouped(data, col, cross, clean = TRUE, ...)

Arguments

data

A tibble.

col

The column holding factor values.

cross

The column holding groups to compare.

clean

Prepare data by data_clean.

...

Placeholder to allow calling the method with unused parameters from effect_counts.

Value

A volker tibble.

Details

Phi is derived from the Chi squared value by sqrt(fit$statistic / n). Cramer's V is derived by phi / sqrt(min(dim(contingency)[1], dim(contingency)[1]) - 1).

Examples

library(volker)
data <- volker::chatgpt

effect_counts_one_grouped(data, adopter, sd_gender)
#> 
#> 
#> |Statistic          | Value|
#> |:------------------|-----:|
#> |Cramer's V         |  0.08|
#> |Number of cases    |   101|
#> |Degrees of freedom |      |
#> |Chi-squared        | 13.48|
#> |p value            | 0.019|
#> |stars              |     *|