# NOT RUN {
# for reproducibility
set.seed(123)
library(statsExpressions)
# ----------------------- parametric -------------------------------------
# between-subjects design
expr_t_twosample(
data = sleep,
x = group,
y = extra,
type = "p"
)
# within-subjects design
expr_t_twosample(
data = VR_dilemma,
x = modality,
y = score,
paired = TRUE,
subject.id = id,
type = "p",
output = "dataframe"
)
# ----------------------- non-parametric ----------------------------------
# between-subjects design
expr_t_twosample(
data = sleep,
x = group,
y = extra,
type = "np"
)
# within-subjects design
expr_t_twosample(
data = VR_dilemma,
x = modality,
y = score,
paired = TRUE,
subject.id = id,
type = "np",
output = "dataframe"
)
# ------------------------------ robust ----------------------------------
# between-subjects design
expr_t_twosample(
data = sleep,
x = group,
y = extra,
type = "r"
)
# within-subjects design
expr_t_twosample(
data = VR_dilemma,
x = modality,
y = score,
paired = TRUE,
subject.id = id,
type = "r",
output = "dataframe"
)
#' # ------------------------------ Bayesian ------------------------------
# between-subjects design
expr_t_twosample(
data = sleep,
x = group,
y = extra,
type = "bayes"
)
# within-subjects design
expr_t_twosample(
data = VR_dilemma,
x = modality,
y = score,
paired = TRUE,
subject.id = id,
type = "bayes",
output = "dataframe"
)
# }
Run the code above in your browser using DataLab