| t_test_b | R Documentation |
One and two sample t-tests on vectors of data
t_test_b(
x,
y,
mu,
paired = FALSE,
data,
heteroscedastic = TRUE,
prior_mean_mu,
prior_mean_nu = 0.001,
prior_var_shape = 0.001,
prior_var_rate = 0.001,
CI_level = 0.95,
ROPE = 0.1,
improper = FALSE,
plot = TRUE,
seed = 1,
mc_error = 0.002
)
x |
Either a (non-empty) numeric vector of data values, or a formula of the form outcome ~ grouping variable. |
y |
an optional (non-empty) numeric vector of data values |
mu |
optional. If supplied, |
paired |
logical. If TRUE, provide both x and y as vectors. |
data |
logical. Only used if x is a formula. |
heteroscedastic |
logical. Set to FALSE to assume all groups have equal variance. |
prior_mean_mu |
numeric. Hyperparameter for the a priori mean of the group means. |
prior_mean_nu |
numeric. Hyperparameter which scales the precision of the group means. |
prior_var_shape |
numeric. Twice the shape parameter for the inverse gamma prior on
the residual variance(s). I.e., |
prior_var_rate |
numeric. Twice the rate parameter for the inverse gamma prior on
the residual variance(s). I.e., |
CI_level |
numeric. Credible interval level. |
ROPE |
numeric. Used to compute posterior probability that Cohen's D +/- ROPE |
improper |
logical. Should we use an improper prior that is proportional to the inverse of the variance? |
plot |
logical. Should the resulting inverse gamma distribution be plotted? |
seed |
integer. Always set your seed!!! |
mc_error |
The number of posterior draws will ensure that with 99%
probability the bounds of the credible intervals will be within |
A one and two sample t-test is nothing more than a special case of
one-way anova. See aov_b for details.
Either an aov_b object, if two samples are being compared, or a list with the following elements:
Variable
Post Mean
Lower (bound of credible interval)
Upper (bound of credible interval)
Prob Dir (Probability of Direction)
# Single population
t_test_b(rnorm(50))
# or an alternative input format
t_test_b(outcome ~ 1,
data = data.frame(outcome = rnorm(50)))
# Two populations
t_test_b(rnorm(50),
rnorm(15,1))
# or an alternative input format
t_test_b(outcome ~ group_variable,
data =
data.frame(outcome = c(rnorm(50),
rnorm(15,1)),
group_variable = rep(c("a","b"),
c(50,15))))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.