sm_effsize {smplot2} | R Documentation |
Cohen's d - effect size
Description
Cohen's d is a measure of the effect size. It is often reported with p-values (ex. from a t-test or posthoc pairwise comparisons).
Usage
sm_effsize(group1, group2, absolute = TRUE)
Arguments
group1 |
Numeric vector containing data from one sample (i.e., group 1) that is to be compared with another group. |
group2 |
Numeric vector containing data from another sample (i.e., group 2) that is to be compared with the former group. |
absolute |
If set TRUE, the function will print the absolute value of the effect size. If set FALSE, the function will print effect size of group2 - group1. For example, it will be positive if group2 has a larger mean than group 1. |
Value
Returns a double vector that is the effect size between two samples.
Examples
library(smplot2)
group1 <- rnorm(10,0,1)
group2 <- rnorm(10,1,1)
sm_effsize(group1, group2)
[Package smplot2 version 0.2.4 Index]