A convenience wrapper that dispatches to the appropriate test function
based on the method argument.
Usage
kernel_causal_test(
formula,
data,
method = c("dr-date", "dr-dett", "bd-hsic"),
...
)See also
Other causal association tests:
bd_hsic_test(),
hierarchical_test(),
mechanism_consistency_test()
Examples
set.seed(42)
n <- 200
dat <- data.frame(
y = rnorm(n),
treatment = rbinom(n, 1, 0.5),
x1 = rnorm(n),
x2 = rnorm(n)
)
dat$y <- dat$y + 0.5 * dat$treatment + 0.3 * dat$x1
result <- kernel_causal_test(y ~ treatment | x1 + x2,
data = dat, method = "dr-date",
n_permutations = 100, seed = 1
)
print(result)
#>
#> DR-DATE Test
#>
#> Statistic: 0.0801612
#> P-value: 0.0099
#> N: 200
#> Perms: 100
#> Kernel Y: rbf (bw = 1.007)
#> ESS: 82.2
#>
