View source: R/cyt_univiariate_multi.R
| cyt_univariate_multi | R Documentation |
cyt_univariate_multiprovides univariate statistical testing for
categorical predictors with more than two levels. For each
categorical predictor and numeric outcome pair, a global test is
performed, followed by pairwise comparisons if the global test is
significant. Users may choose between two methods,
classical ANOVA with Tukey’s Honest Significant Difference (HSD)
or a non‑parametric Kruskal–Wallis test followed by pairwise
Wilcoxon rank–sum tests. The return format can either be a list
of adjusted p‑values for each outcome–predictor pair or, if
format_output = TRUE, a tidy data frame summarizing all
pairwise comparisons.
cyt_univariate_multi(
data,
method = c("anova", "kruskal"),
cat_vars = NULL,
cont_vars = NULL,
p_adjust_method = "BH",
format_output = FALSE
)
data |
A data frame or matrix containing both categorical and continuous variables. Character columns will be converted to factors. |
method |
Character specifying the type of global test to perform. Use "anova" (default) for one‑way ANOVA with Tukey HSD or "kruskal" for Kruskal–Wallis with pairwise Wilcoxon tests. |
cat_vars |
Optional character vector of predictor column
names. When |
cont_vars |
Optional character vector of numeric outcome
variable names. When |
p_adjust_method |
Character string specifying the method for
p‑value adjustment across pairwise comparisons. Passed to
|
format_output |
Logical. If |
Either a list (if format_output = FALSE) or a data
frame (if format_output = TRUE).
Shubh Saraswat
data("ExampleData1")
cyt_univariate_multi(ExampleData1[, c(1:2, 5:6)], method = "kruskal",
format_output = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.