bf_two_sample_ttest
From ggstatsplot v0.0.11
by Indrajeet Patil
Bayesian two-samples t-test.
Bayesian two-samples t-test.
Usage
bf_two_sample_ttest(data, x, y, paired = FALSE, bf.prior = 0.707,
caption = NULL, output = "null", k = 2, ...)
Arguments
- data
for use with
formula
, a data frame containing all the data- x
a vector of observations for the first (or only) group
- y
a vector of observations for the second group (or condition, for paired)
- paired
if
TRUE
, observations are paired- bf.prior
A number between
0.5
and2
(default0.707
), the prior width to use in calculating Bayes factors.- caption
The text for the plot caption.
- output
Can either be
"null"
(or"caption"
or"H0"
, which will contain text for evidence in favor of the null hypothesis or H0) or"alternative"
(or"title"
or"H1"
) or"results"
, which will return a dataframe with results all the details).- k
Number of digits after decimal point (should be an integer) (Default:
k = 2
).- ...
further arguments to be passed to or from methods.
See Also
Examples
# NOT RUN {
# for reproducibility
set.seed(123)
# to get caption (default)
bf_two_sample_ttest(
data = mtcars,
x = am,
y = wt,
paired = FALSE,
bf.prior = 0.880
)
# to see results
bf_two_sample_ttest(
data = mtcars,
x = am,
y = wt,
paired = FALSE,
output = "results"
)
# for paired sample test
bf_two_sample_ttest(
data = dplyr::filter(
ggstatsplot::intent_morality,
condition %in% c("accidental", "attempted"),
harm == "Poisoning"
),
x = condition,
y = rating,
paired = TRUE,
output = "results"
)
# }
Community examples
Looks like there are no examples yet.