# NOT RUN {
# for reproducibility
set.seed(123)
library(statsExpressions)
options(tibble.width = Inf, pillar.bold = TRUE, pillar.neg = TRUE)
# ----------------------- parametric -------------------------------------
# between-subjects
oneway_anova(
data = ggplot2::msleep,
x = vore,
y = sleep_rem
)
if (require("afex", quietly = TRUE)) {
# within-subjects design
oneway_anova(
data = iris_long,
x = condition,
y = value,
subject.id = id,
paired = TRUE
)
}
# ----------------------- non-parametric ----------------------------------
# between-subjects
oneway_anova(
data = ggplot2::msleep,
x = vore,
y = sleep_rem,
type = "np"
)
# within-subjects design
oneway_anova(
data = iris_long,
x = condition,
y = value,
subject.id = id,
paired = TRUE,
type = "np"
)
# ----------------------- robust -------------------------------------
# between-subjects
oneway_anova(
data = ggplot2::msleep,
x = vore,
y = sleep_rem,
type = "r"
)
# within-subjects design
oneway_anova(
data = iris_long,
x = condition,
y = value,
subject.id = id,
paired = TRUE,
type = "r"
)
# ----------------------- Bayesian -------------------------------------
# between-subjects
oneway_anova(
data = ggplot2::msleep,
x = vore,
y = sleep_rem,
type = "bayes"
)
# within-subjects design
oneway_anova(
data = iris_long,
x = condition,
y = value,
subject.id = id,
paired = TRUE,
type = "bayes"
)
# }
Run the code above in your browser using DataLab