ttest {mverse} | R Documentation |
Performs one or two sample t-tests on data columns.
Description
ttest_mverse
performs t-tests across the multiverse.
If x or y is specified, then performs one and two sample t-tests
on specified columns of the data. If both x and y are NULL, then
performs t.test based on the formula branches.
Usage
ttest_mverse(
.mverse,
x = NULL,
y = NULL,
alternative = "two.sided",
mu = 0,
paired = FALSE,
var.equal = FALSE,
conf.level = 0.95
)
Arguments
.mverse |
a |
x |
(optional) column name of data within mverse object |
y |
(optional) column name of data within mverse object |
alternative |
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter. |
mu |
a number indicating the true value of the mean (or difference in means if you are performing a two sample test). |
paired |
a logical indicating whether you want a paired t-test. |
var.equal |
a logical variable indicating whether to treat the two variances as being equal. |
conf.level |
confidence level of the interval. |
Value
A ttest_mverse
object.
Examples
# Performing a unpaired two sample t-test.
mv <- mverse(soccer)
x <- mutate_branch(
((rater1 + rater2) / 2) > mean((rater1 + rater2) / 2),
ifelse(rater1 > rater2, rater1, rater2) >
mean(ifelse(rater1 > rater2, rater1, rater2))
)
y <- mutate_branch(
redCards, yellowCards, yellowReds
)
two_sample_form <- formula_branch(y ~ x)
mv <- mv %>%
add_mutate_branch(x, y) %>%
add_formula_branch(two_sample_form)
ttest_mverse(mv)