Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed May 14, 2024
1 parent 0c01c4c commit 7d39726
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 51 deletions.
4 changes: 3 additions & 1 deletion R/chi_squared_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
#'
#' Interpretation of effect sizes are based on rules described in
#' [`effectsize::interpret_phi()`], [`effectsize::interpret_cramers_v()`],
#' and [`effectsize::interpret_fei()`].
#' and [`effectsize::interpret_fei()`]. Use these function directly to get other
#' interpretations, by providing the returned effect size as argument, e.g.
#' `interpret_phi(0.35, rules = "gignac2016")`.
#'
#' @references
#' - Ben-Shachar, M.S., Patil, I., Thériault, R., Wiernik, B.M.,
Expand Down
12 changes: 6 additions & 6 deletions R/kruskal_wallis_test.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#' @title Kruskal-Wallis test
#' @name kruskal_wallis_test
#' @description This function performs a Kruskal-Wallis rank sum test, to test
#' the null hypothesis that the population median of all of the groups are
#' equal. The alternative is that they differ in at least one. Unlike the
#' underlying base R function `kruskal.test()`, this function allows for
#' weighted tests.
#' @description This function performs a Kruskal-Wallis rank sum test, which is
#' a non-parametric method to test the null hypothesis that the population median
#' of all of the groups are equal. The alternative is that they differ in at
#' least one. Unlike the underlying base R function `kruskal.test()`, this
#' function allows for weighted tests.
#'
#' @inheritParams mann_whitney_test
#' @inherit mann_whitney_test seealso
Expand All @@ -19,7 +19,7 @@
#'
#' - du Prel, J.B., Röhrig, B., Hommel, G., Blettner, M. Auswahl statistischer
#' Testverfahren. Dtsch Arztebl Int 2010; 107(19): 343–8
#'
#'
#' @details The function simply is a wrapper around [`kruskal.test()`]. The
#' weighted version of the Kruskal-Wallis test is based on the **survey** package,
#' using [`survey::svyranktest()`].
Expand Down
14 changes: 9 additions & 5 deletions R/mann_whitney_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@
#' be using a linear mixed model.
#'
#' @seealso
#' - [`mann_whitney_test()`] for unpaired (independent) samples.
#' - [`t_test()`] for parametric t-tests.
#' - [`kruskal_wallis_test()`] for non-parametric ANOVA (i.e. more than two samples).
#' - [`wilcoxon_test()`] for Wilcoxon rank sum tests for paired (dependent) samples.
#' - [`chi_squared_test()`] for chi-squared tests (two categorical variables).
#' - [`t_test()`] for parametric t-tests of dependent and independent samples.
#' - [`mann_whitney_test()`] for non-parametric tests of unpaired (independent)
#' samples.
#' - [`wilcoxon_test()`] for Wilcoxon rank sum tests for non-parametric tests
#' of paired (dependent) samples.
#' - [`kruskal_wallis_test()`] for non-parametric tests with more than two
#' independent samples.
#' - [`chi_squared_test()`] for chi-squared tests (two categorical variables,
#' dependent and independent).
#'
#' @return A data frame with test results. The function returns p and Z-values
#' as well as effect size r and group-rank-means.
Expand Down
18 changes: 14 additions & 4 deletions R/t_test.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#' @title Student's t test
#' @name t_test
#' @description This function performs a Student's t test for two independent
#' samples, for paired samples, or for one sample. Unlike the underlying
#' base R function `t.test()`, this function allows for weighted tests and
#' automatically calculates effect sizes.
#' samples, for paired samples, or for one sample. It's a parametric test for
#' the null hypothesis that the means of two independent samples are equal, or
#' that the mean of one sample is equal to a specified value. The hypothesis
#' can be one- or two-sided.
#'
#' Unlike the underlying base R function `t.test()`, this function allows for
#' weighted tests and automatically calculates effect sizes. Cohen's _d_ is
#' returned for larger samples (n > 20), while Hedges' _g_ is returned for
#' smaller samples.
#'
#' @inheritParams mann_whitney_test
#' @param paired Logical, whether to compute a paired t-test for dependent
Expand All @@ -14,8 +20,12 @@
#'
#' @details Interpretation of effect sizes are based on rules described in
#' [`effectsize::interpret_cohens_d()`] and [`effectsize::interpret_hedges_g()`].
#' Use these function directly to get other interpretations, by providing the
#' returned effect size (_Cohen's d_ or _Hedges's g_ in this case) as argument,
#' e.g. `interpret_cohens_d(0.35, rules = "sawilowsky2009")`.
#'
#' @return A data frame with test results.
#' @return A data frame with test results. Effectsize Cohen's _d_ is returned
#' for larger samples (n > 20), while Hedges' _g_ is returned for smaller samples.
#'
#' @references
#' - Bender, R., Lange, S., Ziegler, A. Wichtige Signifikanztests.
Expand Down
18 changes: 12 additions & 6 deletions man/chi_squared_test.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions man/kruskal_wallis_test.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions man/mann_whitney_test.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 23 additions & 9 deletions man/t_test.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions man/wilcoxon_test.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7d39726

Please sign in to comment.