RoBTT
is used to estimate a Robust Bayesian
T-Test. The input either requires the vector of observations for
each group, x1, x2
, or the summary statistics (in case only
the "normal"
likelihood is used).
RoBTT(
x1 = NULL,
x2 = NULL,
mean1 = NULL,
mean2 = NULL,
sd1 = NULL,
sd2 = NULL,
N1 = NULL,
N2 = NULL,
prior_delta = prior(distribution = "cauchy", parameters = list(location = 0, scale =
sqrt(2)/2)),
prior_rho = prior(distribution = "beta", parameters = list(alpha = 1, beta = 1)),
prior_nu = prior(distribution = "exp", parameters = list(rate = 1)),
prior_delta_null = prior(distribution = "spike", parameters = list(location = 0)),
prior_rho_null = prior(distribution = "spike", parameters = list(location = 0.5)),
prior_nu_null = prior_none(),
chains = 4,
iter = 10000,
warmup = 5000,
thin = 1,
parallel = FALSE,
control = set_control(),
convergence_checks = set_convergence_checks(),
save = "all",
seed = NULL,
silent = TRUE,
...
)
vector of observations of the first group
vector of observations of the second group
mean of the first group
mean of the first group
standard deviation of the first group
standard deviation of the first group
sample size of the first group
sample size of the first group
prior distributions for the effect size delta
parameter
that will be treated as belonging to the alternative hypothesis. Defaults to
prior(distribution = "Cauchy", parameters = list(location = 0, scale = sqrt(2)/2))
.
prior distributions for the precision allocation rho
parameter
that will be treated as belonging to the alternative hypothesis. Defaults to
prior(distribution = "beta", parameters = list(alpha = 1, beta = 1))
.
prior distribution for the degrees of freedom + 2 nu
parameter that will be treated as belonging to the alternative hypothesis.
Defaults to prior(distribution = "exp", parameters = list(rate = 1))
.
prior distribution for the delta
parameter that
will be treated as belonging to the null hypothesis. Defaults to point distribution
with location at 0 (
prior(distribution = "point", parameters = list(location = 0))
).
prior distribution for the rho
parameter that
will be treated as belonging to the null hypothesis. Defaults to point distribution
with location at 0.5 (
prior(distribution = "point", parameters = list(location = 0.5))
).
prior distribution for the nu
parameter
that will be treated as belonging to the null hypothesis. Defaults to prior_none
(
(i.e., normal likelihood)).
a number of chains of the MCMC algorithm.
a number of sampling iterations of the MCMC algorithm.
Defaults to 10000
, with a minimum of 4000
.
a number of warmup iterations of the MCMC algorithm.
Defaults to 5000
.
a thinning of the chains of the MCMC algorithm. Defaults to
1
.
whether the individual models should be fitted in parallel.
Defaults to FALSE
. The implementation is not completely stable
and might cause a connection error.
allows to pass control settings with the
set_control()
function. See ?set_control
for
options and default settings.
automatic convergence checks to assess the fitted
models, passed with set_convergence_checks()
function. See
?set_convergence_checks
for options and default settings.
whether all models posterior distributions should be kept
after obtaining a model-averaged result. Defaults to "all"
which
does not remove anything. Set to "min"
to significantly reduce
the size of final object, however, some model diagnostics and further
manipulation with the object will not be possible.
a seed to be set before model fitting, marginal likelihood
computation, and posterior mixing for reproducibility of results. Defaults
to NULL
- no seed is set.
whether all print messages regarding the fitting process
should be suppressed. Defaults to TRUE
. Note that parallel = TRUE
also suppresses all messages.
additional arguments.
See Maier et al. (2022) for more details regarding the methodology.
Generic summary.RoBTT()
, print.RoBTT()
, and plot.RoBTT()
functions are
provided to facilitate manipulation with the ensemble.
Maier M, Bartoš F, Quintana DS, van den Bergh D, Marsman M, Ly A, Wagenmakers E (2022). “Model-averaged Bayesian t-tests.” doi:10.31234/osf.io/d5zwc , PsyArxiv Preprint.
if (FALSE) {
# using the example data from Darwin
data("fertilization", package = "RoBTT")
fit <- RoBTT(
x1 = fertilization$Self,
x2 = fertilization$Crossed,
prior_delta = prior("cauchy", list(0, 1/sqrt(2))),
prior_rho = prior("beta", list(3, 3)),
seed = 1,
chains = 1,
warmup = 1000,
iter = 2000,
control = set_control(adapt_delta = 0.95)
)
# summary can provide many details about the model
summary(fit)
}