RoBTT
is used to estimate a robust Bayesian
t-test or truncated Bayesian t-test (if truncation
is used).
The input either requires the vector of observations for
each group, x1, x2
, or the summary statistics (only if the normal
likelihood models are used).
RoBTT(
x1 = NULL,
x2 = NULL,
mean1 = NULL,
mean2 = NULL,
sd1 = NULL,
sd2 = NULL,
N1 = NULL,
N2 = NULL,
truncation = 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 = if (is.null(truncation)) 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(),
prior_mu = NULL,
prior_sigma2 = NULL,
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
an optional list specifying truncation applied to the data.
Defaults to NULL
, i.e., no truncation was applied and the full likelihood is
applied. Alternative the truncation can be specified via a named list with:
"x"
where x
is a vector of two values specifying the lower
and upper truncation points common across the groups
"x1"
and "x2"
where x1
is a vector of two values specifying
the lower and upper truncation points for the first group and x2
is a vector of
two values specifying the lower and upper truncation points for the second group.
"sigma"
where sigma
corresponds to the number of standard deviations
from the common mean where the truncation points should be set.
"sigma1"
and "sigma2"
where sigma1
corresponds to the number of
standard deviations from the mean of the first group where the truncation points should be set
and sigma2
corresponds to the number of standard deviations from the mean of the second
group where the truncation points should be set.
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))
if no
truncation
is specified. If truncation
is specified, the default is
NULL
(i.e., use only normal likelihood).
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)).
prior distribution for the grand mean parameter. Defaults to NULL
which sets Jeffreys prior for the grand mean in case of no truncation or an unit Cauchy
prior distributions for the grand mean in case of truncation (which greatly improves
sampling efficiency).
prior distribution for the grand variance parameter. Defaults to NULL
which sets Jeffreys prior for the variance in case of no truncation or an exponential prior
distribution for the variance in case of truncation (which greatly improves sampling efficiency).
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 robust Bayesian t-test methodology and the corresponding
vignette (vignette("Introduction_to_RoBTT", package = "RoBTT")
).
See Godmann et al. (2024)
for more details
regarding the truncated Bayesian t-test methodology and the corresponding
vignette (vignette("Truncated_t_test", package = "RoBTT")
).
Generic summary.RoBTT()
, print.RoBTT()
, and plot.RoBTT()
functions are provided to facilitate manipulation with the ensemble.
Godmann HR, Bartoš F, Wagenmakers E (2024).
“A truncated t-test: Excluding outliers without biasing the Bayes factor.”
PsyArxiv Preprint.
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)
}