bfslice_u {dslice} | R Documentation |
Dependency detection between a level k
(k > 1
) categorical variable and a continuous variable via Bayes factor.
Description
Dependency detection between a level k
(k > 1
) categorical variable x
and a continuous variable y
via Bayes factor.
Usage
bfslice_u(x, dim, lambda, alpha)
Arguments
x |
Vector: observations of categorical variable, |
dim |
Level of |
lambda |
|
alpha |
|
Value
Value of Bayes factor (nonnegative). Bayes factor could be treated as a statistic and one can take some threshold then calculates the corresponded Type I error rate. One can also take the value of Bayes factor for judgement.
References
Jiang, B., Ye, C. and Liu, J.S. Bayesian nonparametric tests via sliced inverse modeling. Bayesian Analysis, 12(1): 89-112, 2017.
See Also
Examples
n <- 100
mu <- 0.5
y <- c(rnorm(n, -mu, 1), rnorm(n, mu, 1))
x <- c(rep(0, n), rep(1, n))
x <- x[order(y)]
dim <- max(x) + 1
lambda <- 1.0
alpha <- 1.0
bfval <- bfslice_u(x, dim, lambda, alpha)