Skip to content

Commit 3a3e291

Browse files
committed
Expand on returned value
#227
1 parent 4aeb336 commit 3a3e291

31 files changed

+151
-46
lines changed

R/adjust.R

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
#' Adjust data for the effect of other variable(s)
22
#'
3-
#' This function can be used to adjust the data for the effect of other variables present in the dataset. It is based on an underlying fitting of regressions models, allowing for quite some flexibility, such as including factors as random effects in mixed models (multilevel partialization), continuous variables as smooth terms in general additive models (non-linear partialization) and/or fitting these models under a Bayesian framework. The values returned by this function are the residuals of the regression models. Note that a regular correlation between two "adjusted" variables is equivalent to the partial correlation between them.
3+
#' This function can be used to adjust the data for the effect of other
4+
#' variables present in the dataset. It is based on an underlying fitting of
5+
#' regressions models, allowing for quite some flexibility, such as including
6+
#' factors as random effects in mixed models (multilevel partialization),
7+
#' continuous variables as smooth terms in general additive models (non-linear
8+
#' partialization) and/or fitting these models under a Bayesian framework. The
9+
#' values returned by this function are the residuals of the regression models.
10+
#' Note that a regular correlation between two "adjusted" variables is
11+
#' equivalent to the partial correlation between them.
412
#'
513
#' @param data A dataframe.
6-
#' @param effect Character vector of column names to be adjusted for (regressed out). If `NULL` (the default), all variables will be selected.
14+
#' @param effect Character vector of column names to be adjusted for (regressed
15+
#' out). If `NULL` (the default), all variables will be selected.
716
#' @inheritParams standardize
8-
#' @param multilevel If `TRUE`, the factors are included as random factors. Else, if `FALSE` (default), they are included as fixed effects in the simple regression model.
9-
#' @param additive If `TRUE`, continuous variables as included as smooth terms in additive models. The goal is to regress-out potential non-linear effects.
10-
#' @param bayesian If `TRUE`, the models are fitted under the Bayesian framework using `rstanarm`.
17+
#' @param multilevel If `TRUE`, the factors are included as random factors.
18+
#' Else, if `FALSE` (default), they are included as fixed effects in the
19+
#' simple regression model.
20+
#' @param additive If `TRUE`, continuous variables as included as smooth terms
21+
#' in additive models. The goal is to regress-out potential non-linear
22+
#' effects.
23+
#' @param bayesian If `TRUE`, the models are fitted under the Bayesian framework
24+
#' using `rstanarm`.
25+
#'
26+
#' @return A data frame comparable to `data`, with adjusted variables.
1127
#'
1228
#' @examples
1329
#' adjust(iris, effect = "Species", select = "Sepal.Length")

R/cohens_d.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
#' tail-probabilities, and then convert these `ncp`s to the corresponding effect
4141
#' sizes.
4242
#'
43-
#' @return A data frame with the effect size(s) and confidence interval(s).
43+
#' @return A data frame with the effect size ( `Cohens_d`, `Hedges_g`,
44+
#' `Glass_delta`) and their CIs (`CI_low` and `CI_high`).
4445
#'
4546
#' @seealso [d_to_common_language()] [sd_pooled()]
4647
#' @family effect size indices

R/convert_OR_to_RR.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#' @param p0 Baseline risk
55
#' @inheritParams oddsratio_to_d
66
#'
7+
#' @return Converted index.
8+
#'
79
#' @family convert between effect sizes
810
#'
911
#' @examples

R/convert_chisq.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
#' @param adjust Should the effect size be bias-corrected? Defaults to `FALSE`.
1212
#' @param ... Arguments passed to or from other methods.
1313
#'
14-
#' @return A data frame with the effect size(s) between 0-1, and confidence interval(s).
14+
#' @return A data frame with the effect size(s) between 0-1, and confidence
15+
#' interval(s). See [cramers_v()].
1516
#'
1617
#' @details These functions use the following formulae:
1718
#' \cr

R/convert_d_to_common_language.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#' \cr\cr
1111
#' \deqn{Pr(superiority) = \Phi(d/\sqrt{2})}
1212
#'
13+
#' @return A list of `Cohen's U3`, `Overlap`, `Probability of superiority`.
14+
#'
1315
#' @note
1416
#' These calculations assume that the populations have equal variance and are
1517
#' normally distributed.

R/convert_odds_to_probs.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#' from transformation.
1010
#' @param ... Arguments passed to or from other methods.
1111
#'
12+
#' @return Converted index.
13+
#'
1214
#' @seealso [stats::plogis()]
1315
#' @family convert between effect sizes
1416
#'

R/convert_tF_to_pve.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
#' @inheritParams chisq_to_phi
1616
#' @param ... Arguments passed to or from other methods.
1717
#'
18-
#' @return A data frame with the effect size(s) between 0-1, and confidence interval(s) (Note that for \eqn{\omega_p^2} and \eqn{\epsilon_p^2}
19-
#' it is possible to compute a negative number; even though this doesn't make any practical sense,
20-
#' it is recommended to report the negative number and not a 0).
18+
#' @return A data frame with the effect size(s) between 0-1 (`Eta2_partial`,
19+
#' `Epsilon2_partial`, `Omega2_partial`, `Cohens_f_partial` or
20+
#' `Cohens_f2_partial`), and their CIs (`CI_low` and `CI_high`). (Note that
21+
#' for \eqn{\omega_p^2} and \eqn{\epsilon_p^2} it is possible to compute a
22+
#' negative number; even though this doesn't make any practical sense, it is
23+
#' recommended to report the negative number and not a 0).
2124
#'
2225
#' @details These functions use the following formulae:
2326
#' \cr

R/convert_tFz_to_r.R

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,27 @@
22

33
#' Convert test statistics (t, z, F) to effect sizes of differences (Cohen's d) or association (**partial** r)
44
#'
5-
#' These functions are convenience functions to convert t, z and F test statistics to Cohen's d and
6-
#' **partial** r. These are useful in cases where the data required to compute these are not easily
7-
#' available or their computation is not straightforward (e.g., in liner mixed models, contrasts, etc.).
5+
#' These functions are convenience functions to convert t, z and F test
6+
#' statistics to Cohen's d and **partial** r. These are useful in cases where
7+
#' the data required to compute these are not easily available or their
8+
#' computation is not straightforward (e.g., in liner mixed models, contrasts,
9+
#' etc.).
810
#' \cr
911
#' See [Effect Size from Test Statistics vignette.](https://easystats.github.io/effectsize/articles/from_test_statistics.html)
1012
#'
1113
#' @param t,f,z The t, the F or the z statistics.
12-
#' @param df,df_error Degrees of freedom of numerator or of the error estimate (i.e., the residuals).
14+
#' @param df,df_error Degrees of freedom of numerator or of the error estimate
15+
#' (i.e., the residuals).
1316
#' @param n The number of observations (the sample size).
14-
#' @param paired Should the estimate accout for the t-value being testing the difference between dependant means?
17+
#' @param paired Should the estimate accout for the t-value being testing the
18+
#' difference between dependant means?
1519
#' @param pooled Deprecated. Use `paired`.
1620
#' @inheritParams chisq_to_phi
1721
#' @param ... Arguments passed to or from other methods.
1822
#'
1923
#'
20-
#' @return A data frame with the effect size(s) between 0-1, and confidence interval(s)
24+
#' @return A data frame with the effect size(s)(`r` or `d`), and their CIs
25+
#' (`CI_low` and `CI_high`).
2126
#'
2227
#'
2328
#' @details These functions use the following formulae to approximate *r* and *d*:

R/effectsize.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
#' **For statistical models it is recommended to directly use the listed
2525
#' functions, for the full range of options they provide.**
2626
#'
27+
#' @return A data frame with the effect size (depending on input) and and its
28+
#' CIs (`CI_low` and `CI_high`).
29+
#'
2730
#' @family effect size indices
2831
#'
2932
#' @examples

R/equivalence_test.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bayestestR::equivalence_test
3535
#'
3636
#' @seealso For more details, see [bayestestR::equivalence_test()].
3737
#'
38-
#' @return A data frame.
38+
#' @return A data frame with the results of the equivalence test.
3939
#'
4040
#' @references
4141
#' - Campbell, H., & Gustafson, P. (2018). Conditional equivalence testing: An alternative remedy for publication bias. PLOS ONE, 13(4), e0195145. https://doi.org/10.1371/journal.pone.0195145

0 commit comments

Comments
 (0)