cohensD: Cohen's D

Description Usage Arguments Value Examples

View source: R/cohensD.R

Description

This function calculates Cohen's D, an effect size measure. If sample sizes are not equal use the unbiased modifier.

Usage

1
cohensD(meanA, meanB, sdA, sdB, nA, nB, unbiased = F, verbose = F)

Arguments

meanA

Mean of Group A

meanB

Mean of Group B

sdA

SD of Group A

sdB

SD of Group B

nA

Sample size of Group A

nB

Sample size of Group B

unbiased

If set to FALSE the sample size will be assumed to be equal

verbose

Extra printed information

Value

Cohen's D

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
GroupA <- rnorm(1000,10, 2)
GroupB <- rnorm(1000,20, 4)

meanGroupA <- mean(GroupA)
meanGroupB <- mean(GroupB)

sigmaGroupA <- sd(GroupA)
sigmaGroupB <- sd(GroupB)

cohensD(meanA = meanGroupA,
        meanB = meanGroupB,
        sdA = sigmaGroupA,
        sdB = sigmaGroupB,
        nA = 1000, nB = 1000,
        unbiased = TRUE,
        verbose = TRUE)

LionelRohner/LRTools documentation built on Dec. 17, 2021, 1:10 a.m.