bfslice_u | R Documentation |
k
(k > 1
) categorical variable and a continuous variable via Bayes factor.
Dependency detection between a level k
(k > 1
) categorical variable x
and a continuous variable y
via Bayes factor.
bfslice_u(x, dim, lambda, alpha)
x |
Vector: observations of categorical variable, |
dim |
Level of |
lambda |
|
alpha |
|
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.
Jiang, B., Ye, C. and Liu, J.S. Bayesian nonparametric tests via sliced inverse modeling. Bayesian Analysis, 12(1): 89-112, 2017.
bfslice_c, bfslice_eqp_u
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.