# Calculate from raw data
cohens_d(c(10, 15, 11, 14, 17), c(22, 18, 23, 25, 20))
# Methods when working with data frames
cohens_d(sleep, dv = extra, iv = group, paired = TRUE)
# or
cohens_d(sleep, dv = "extra", iv = "group", paired = TRUE)
# formula interface
sleep2 <- reshape(sleep, direction = "wide", idvar = "ID", timevar = "group")
cohens_d(Pair(extra.1, extra.2) ~ 1, sleep2, paired = TRUE)
# Or pass a call to t_test or t.test
cohens_d(t_test(Pair(extra.1, extra.2) ~ 1, sleep2))
Run the code above in your browser using DataLab