Description Usage Arguments Details Value Warning References Examples
View source: R/meanDiff.multi.R
The meanDiff.multi function compares many means for many groups. It presents the results in a dataframe summarizing all relevant information, and produces plot showing the confidence intervals for the effect sizes for each predictor (i.e. dichotomous variable). Like meanDiff, it computes Cohen's d, the unbiased estimate of Cohen's d (Hedges' g), and performs a t-test. It also shows the achieved power, and, more usefully, the power to detect small, medium, and large effects.
1 2 3 4 | meanDiff.multi(dat, y, x=NULL, var.equal = "yes", conf.level = .95,
digits = 2, orientation = "vertical",
zeroLineColor = "grey", zeroLineSize = 1.2,
envir = parent.frame())
|
dat |
The dataframe containing the variables involved in the mean tests. |
y |
Character vector containing the list of interval variables to include in the tests. |
x |
Character vector containing the list of the dichotomous variables to include in the tests. If x is empty, paired samples t-tests will be conducted. |
var.equal |
String; only relevant if x & y are independent; can be "test" (default; test whether x & y have different variances), "no" (assume x & y have different variances; see the Warning below!), or "yes" (assume x & y have the same variance) |
conf.level |
Confidence of confidence intervals you want. |
digits |
With what precision you want the results to print. |
orientation |
Whether to plot the effect size confidence intervals vertically (like a forest plot, the default) or horizontally. |
zeroLineColor |
Color of the horizontal line at an effect size of 0 (set to 'white' to not display the line; also adjust the size to 0 then). |
zeroLineSize |
Size of the horizontal line at an effect size of 0 (set to 0 to not display the line; also adjust the color to 'white' then). |
envir |
The environment where to search for the variables (useful when calling meanDiff from a function where the vectors are defined in that functions environment). |
This function uses the meanDiff function, which uses the formulae from Borenstein, Hedges, Higgins & Rothstein (2009) (pages 25-32).
An object is returned with the following elements:
results.raw |
Objects returned by the calls to meanDiff. |
plots |
For every comparison, a plot with the datapoints, means, and confidence intervals in the two groups. |
results.compiled |
Dataframe with the most important results from each comparison. |
plots.compiled |
For every dichotomous (x) variable, a plot with the confidence interval for the effect size of each dependent (y) variable. |
input |
The arguments with which the function was called. |
Note that when different variances are assumed for the t-test (i.e. the null-hypothesis test), the values of Cohen's d are still based on the assumption that the variance is equal. In this case, the confidence interval might, for example, not contain zero even though the NHST has a non-significant p-value (the reverse can probably happen, too).
Borenstein, M., Hedges, L. V., Higgins, J. P., & Rothstein, H. R. (2011). Introduction to meta-analysis. John Wiley & Sons.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.