# NOT RUN {
# One-sample t test effect size
ToothGrowth %>% cohens_d(len ~ 1, mu = 0)
# Two indepedent samples t-test effect size
ToothGrowth %>% cohens_d(len ~ supp, var.equal = TRUE)
# Paired samples effect size
df <- data.frame(
id = 1:5,
pre = c(110, 122, 101, 120, 140),
post = c(150, 160, 110, 140, 155)
)
df <- df %>% gather(key = "treatment", value = "value", -id)
head(df)
df %>% cohens_d(value ~ treatment, paired = TRUE)
# }
Run the code above in your browser using DataLab