# NOT RUN {
dat1 <- data.frame(group1 = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2),
group2 = c(1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3),
x = c(3, 1, 4, 2, 5, 3, 2, 3, 6, 6, 3, NA))
#--------------------------------------
# Two-Sample Design
# Two-sided two-sample Welch-test
test.welch(x ~ group1, data = dat1)
# One-sided two-sample Welch-test
test.welch(x ~ group1, data = dat1, alternative = "greater")
# Two-sided two-sample Welch-test
# print Cohen's d with weighted pooled SD
test.welch(x ~ group1, data = dat1, effsize = TRUE)
# Two-sided two-sample Welch-test
# print Cohen's d with unweighted pooled SD
test.welch(x ~ group1, data = dat1, effsize = TRUE, weighted = FALSE)
# Two-sided two-sample Welch-test
# print Cohen's d with weighted pooled SD and
# small sample correction factor
test.welch(x ~ group1, data = dat1, effsize = TRUE, correct = TRUE)
# Two-sided two-sample Welch-test
# print Cohen's d with SD of the reference group 1
test.welch(x ~ group1, data = dat1, effsize = TRUE,
ref = 1)
# Two-sided two-sample Welch-test
# print Cohen's d with weighted pooled SD and
# small sample correction factor
test.welch(x ~ group1, data = dat1, effsize = TRUE,
correct = TRUE)
# Two-sided two-sample Welch-test
# do not print hypotheses and descriptive statistics,
test.welch(x ~ group1, data = dat1, descript = FALSE, hypo = FALSE)
# Two-sided two-sample Welch-test
# print descriptive statistics with 3 digits and p-value with 5 digits
test.welch(x ~ group1, data = dat1, digits = 3, p.digits = 5)
#--------------------------------------
# Multiple-Sample Design
# Welch's ANOVA
test.welch(x ~ group2, data = dat1)
# Welch's ANOVA
# print eta-squared and omega-squared
test.welch(x ~ group2, data = dat1, effsize = TRUE)
# Welch's ANOVA
# do not print hypotheses and descriptive statistics,
test.welch(x ~ group2, data = dat1, descript = FALSE, hypo = FALSE)
# }
Run the code above in your browser using DataLab