bfslice_eqp_u {dslice} | R Documentation |
Dependency detection between a level
(
) categorical variable and a continuous variable via Bayes factor with given size of each group.
Description
Dependency detection between a level (
) categorical variable
x
and a continuous variable y
via Bayes factor with -resolution. The basic idea is almost the same as
bfslice_u
. The only different is that bfslice_eqp_u
groups samples into approximate groups which contain approximate
samples and treat the groups as a sample to calculate Bayes facor.
Usage
bfslice_eqp_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 <- 1000
mu <- 0.2
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_eqp_u(x, dim, lambda, alpha)