# NOT RUN {
# for reproducibility
set.seed(123)
library(statsExpressions)
# ------------------------ association tests -----------------------------
# without counts data
expr_contingency_tab(
data = mtcars,
x = am,
y = cyl,
paired = FALSE
)
# ------------------------ goodness of fit tests ---------------------------
# with counts
expr_contingency_tab(
data = as.data.frame(HairEyeColor),
x = Eye,
counts = Freq,
ratio = c(0.2, 0.2, 0.3, 0.3)
)
# }
Run the code above in your browser using DataLab