sm_effsize | R Documentation |
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).
sm_effsize(group1, group2, absolute = TRUE)
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. |
Returns a double vector that is the effect size between two samples.
library(smplot2)
group1 <- rnorm(10,0,1)
group2 <- rnorm(10,1,1)
sm_effsize(group1, group2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.