calc_ttest_2 | R Documentation |
Internal function - two-sample t-test used in public function calc_ttest()
calc_ttest_2(
data,
var,
by = NULL,
mu = 0,
paired = FALSE,
var_equal = FALSE,
df_form = "Satterthwaite",
conf_level = 0.95,
check_variance = FALSE,
reverse_groups = FALSE,
show_cohens_d = FALSE,
show_alternative = FALSE,
include_perm = FALSE,
n_perms = 10000,
include_np = FALSE
)
data |
A data frame or tibble. |
var |
A (non-empty) numeric vector of data values. |
by |
A factor (or character) with two levels giving the corresponding groups. |
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 |
logical variable indicating whether to treat the two variances as being equal. If TRUE then the pooled variance is used to estimate the variance otherwise if FALSE then unequal variance is assumed and the Welch (or Satterthwaite) approximation to the degrees of freedom is used. |
df_form |
If unequal variances are assumed, then specify to use "Welch"
or "Satterthwaite" (default) approximation to the degrees of freedom. R
|
conf_level |
Confidence level of the interval. Default level is 0.95. |
check_variance |
A logical whether to return some tests of homogeneity of variances. Bartlett's, Levene's, Fligner, and check of the ratio of the standard deviations. |
reverse_groups |
If TRUE, then uses |
show_cohens_d |
Logical whether to return the effect size, Cohen's d. T-test conventional effect sizes, proposed by Cohen, are: 0.2 (small effect), 0.5 (moderate effect) and 0.8 (large effect) (Cohen 1998, Navarro (2015)). This means that if two groups' means don’t differ by 0.2 standard deviations or more, the difference is trivial, even if it is statistically significant. |
show_alternative |
Logical whether to show alternative hypothesis notation in the test results. Default is FALSE. |
include_perm |
Logical indicating whether to perform a permutation test in addition to the t-test. Default is FALSE. |
n_perms |
Number of permutations to perform for the permutation test. Default is 10000. |
include_np |
Logical indicating whether to perform a non-parametric test (Wilcoxon rank-sum or Mann-Whitney U test) in addition to the t-test. Default is FALSE. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.