Learn R Programming

smplot2 (version 0.2.5)

sm_effsize: 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)

Value

Returns a double vector that is the effect size between two samples.

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.

Examples

Run this code
library(smplot2)
group1 <- rnorm(10,0,1)
group2 <- rnorm(10,1,1)
sm_effsize(group1, group2)

Run the code above in your browser using DataLab