Description Usage Arguments References Examples
Calculate Cohen's d from raw data or a call to t_test
/t.test
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | cohens_d(...)
## Default S3 method:
cohens_d(x, y = NULL, paired = FALSE, corr = c("none",
"hedges_g", "glass_delta"), na.rm = FALSE, ...)
## S3 method for class 'data.frame'
cohens_d(data, dv, iv, paired = FALSE, corr = c("none",
"hedges_g", "glass_delta"), na.rm = FALSE, ...)
## S3 method for class 'formula'
cohens_d(formula, data, paired = FALSE, corr = c("none",
"hedges_g", "glass_delta"), na.rm = FALSE, ...)
## S3 method for class 'htest'
cohens_d(ttest, corr = c("none", "hedges_g", "glass_delta"),
...)
|
... |
Further arguments passed to methods. |
x |
a (non-empty) numeric vector of data values. |
y |
an optional (non-empty) numeric vector of data values. |
paired |
a logical indicating whether Cohen's d should be calculated for a paired sample or two independent samples (default). Ignored when calculating Cohen's for one sample. |
corr |
character specifying the correction applied to calculation of the
effect size: |
na.rm |
logical. Should missing values be removed? |
data |
a data frame containing either the variables in the formula
|
dv |
character indicating the name of the column in |
iv |
character indicating the name of the column in |
formula |
a formula of the form |
ttest |
an object of class |
Lakens, D. (2013). Calculating and reporting effect sizes to facilitate cumulative science: a practical primer for t-tests and ANOVAs. Frontiers in Psychology, 4, 863. doi:10.3389/fpsyg.2013.00863
1 2 3 4 5 6 7 8 9 10 11 | cohens_d(c(10, 15, 11, 14, 17), c(22, 18, 23, 25, 20))
# Methods when working with data frames
cohens_d(hquest, dv = sens_seek, iv = group)
# or
cohens_d(hquest, dv = "sens_seek", iv = "group")
# formula interface
cohens_d(sens_seek ~ group, hquest)
# Or pass a call to t_test or t.test
cohens_d(t_test(sens_seek ~ group, hquest))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.