Chi-squared (Pearson, lambda = 1) discrete CI test.

chi_squared(data, yates = TRUE)

Arguments

data

A dataset() result or a data.frame.

yates

Whether to apply Yates' continuity correction on 2x2 sub-tables (default TRUE, the scipy/pgmpy convention).

Value

A fastcit_test bound to data.

Examples

df <- data.frame(A = sample(0:1, 80, TRUE), B = sample(0:1, 80, TRUE))
chi <- chi_squared(dataset(df))
run_test(chi, "A", "B")
#> $statistic
#> [1] 0.001134199
#> 
#> $p_value
#> [1] 0.973134
#> 
#> $dof
#> [1] 1
#> 
#> $effect_size
#> [1] 0.003765301
#>