Learn R Programming

BaylorEdPsych (version 0.5)

CohensD.unpairedT: Cohen's d from an unpaired (indepednet samples) t-test

Description

Calculate's Cohen's d using results from an unpaired (indepednet samples) t-test

Usage

CohensD.unpairedT(t.val, n1, n2)

Arguments

t.val
t statistic from unpaired/indepednet samples t-test
n1
Sample size for group 1
n2
Sample size for group 2

Value

Cohen's d effect size

References

Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Mahwah, NJ: Erlbaum.

See Also

t.test

Examples

Run this code
#Simulate data
set.seed(4565)
Treat<-rnorm(100,.5,1)
set.seed(45651)
Control<-rnorm(100,0,1)
t<-t.test(Treat,Control, var.equal = TRUE)$statistic
nt<-length(Treat)
nc<-length(Control)

CohensD.unpairedT(t, nt, nc)

Run the code above in your browser using DataLab