if (FALSE) { # identical(Sys.getenv("NOT_CRAN"), "true")
# for reproducibility
set.seed(123)
library(statsExpressions)
# parametric -------------------------------------
# between-subjects design
two_sample_test(
data = sleep,
x = group,
y = extra,
type = "p"
)
# within-subjects design
two_sample_test(
data = dplyr::filter(bugs_long, condition %in% c("HDHF", "HDLF")),
x = condition,
y = desire,
paired = TRUE,
subject.id = subject,
type = "p"
)
# non-parametric ----------------------------------
# between-subjects design
two_sample_test(
data = sleep,
x = group,
y = extra,
type = "np"
)
# within-subjects design
two_sample_test(
data = dplyr::filter(bugs_long, condition %in% c("HDHF", "HDLF")),
x = condition,
y = desire,
paired = TRUE,
subject.id = subject,
type = "np"
)
# robust ----------------------------------
# between-subjects design
two_sample_test(
data = sleep,
x = group,
y = extra,
type = "r"
)
# within-subjects design
two_sample_test(
data = dplyr::filter(bugs_long, condition %in% c("HDHF", "HDLF")),
x = condition,
y = desire,
paired = TRUE,
subject.id = subject,
type = "r"
)
#' # Bayesian ------------------------------
# between-subjects design
two_sample_test(
data = sleep,
x = group,
y = extra,
type = "bayes"
)
# within-subjects design
two_sample_test(
data = dplyr::filter(bugs_long, condition %in% c("HDHF", "HDLF")),
x = condition,
y = desire,
paired = TRUE,
subject.id = subject,
type = "bayes"
)
}
Run the code above in your browser using DataLab