Run a conditional-independence test.

run_test(test, x, y, z = character())

Arguments

test

A fastcit_test from one of the factory functions.

x, y

Column names (length-1 character) for the two variables.

z

Character vector of conditioning column names (default: none).

Value

A named list list(statistic, p_value, dof, effect_size); absent fields are NULL.

Examples

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