Learn R Programming

smallstuff (version 1.0.3)

dCohen: Cohen's d

Description

Calculate Cohen's d for one-sample t tests or two-sample independent tests or two-sample paired t-tests

Usage

dCohen(x, y = NULL, mu0 = 0, paired = FALSE)

Value

value of Cohen's d

Arguments

x

vector with (numeric) data

y

for two-sample tests, a vector with (numeric) data for group 2

mu0

for one-sample tests, the number to test against

paired

TRUE for a paired two-sample t-test, FALSE for an independent sample t-test

Examples

Run this code
#one-sample
x=c(1:10,5,6,3:8)
dCohen(x,mu0=7)

#two-sample independent
y=1:15
dCohen(x,y)

#two-sample paired
dCohen(x,1:18,paired=TRUE)

Run the code above in your browser using DataLab