View source: R/get_complex_anova.R
get_complex_anova | R Documentation |
get_complex_anova() performs automated ANOVA and subsequent posthoc test on a set of dependent variables.
get_complex_anova(
tibble,
grp = NULL,
lhs,
rhs,
base.size = 14,
legend = "none",
spe.contr = FALSE,
specs = NA_character_,
by = NA_character_,
adjust.emm.comp = "tukey",
block = NA_character_,
jumps = 0
)
tibble |
a tibble. |
grp |
a string indicating the column which contains the names of the dependent variables. |
lhs |
a string indicating the column which contains the values of the dependent variables. |
rhs |
a string indicating the name(s) of the independent variable(s). Must follow the classic formula rules (use "+", "*" and ":" as separators). |
base.size |
a numeric provided to the base_size argument of theme_pubr() for plotting. |
legend |
a string provided to the legend argument of theme_pubr() for plotting. Must be one of "top", "bottom", "left", "right", "none". |
spe.contr |
a logical indicating if estimated marginal means are desired over a specific independent variable in case of significant interaction. Default is FALSE. |
specs |
if spe.contr = TRUE, a string indicating the name of the independent variable over which estimated marginal means are desired. Will be used in case of significant interaction between the independent variables passed to the specs and by arguments. Default is NA_character_. |
by |
if spe.contr = TRUE, a string indicating the name of the independent variable to condition on. Will be used in case of significant interaction between the independent variables passed to the specs and by arguments. Default is NA_character_. |
adjust.emm.comp |
a string indicating which adjustment method should be used after computation of estimated marginal means. Must be one of "tukey", "scheffe", "sidak", "bonferroni", "dunnettx", "mvt", and "none". Default is "tukey". |
block |
a character vector indicating the name(s) of the independent variable(s) for which the ANOVA-associated p values should not be displayed on the plot. Default is NA_character_. |
jumps |
a numeric indicating the number of new lines that should be added at the end of the caption which provides ANOVA-associated p values on the plot. |
Normality of residuals is tested with Shapiro–Wilk test. In case of normality, the model is used for all subsequent analyses. In case of non-normality, the dependent variable is subjected to Box-Cox transformation and normality of residuals is tested again with Shapiro–Wilk test. In case of normality, the Box-Cox-transformed model is used for all subsequent analyses. In case of non-normality after Box-Cox transformation, the dependent variable is subjected to log transformation and normality of residuals is tested once again with Shapiro–Wilk test. In case of normality, the log-transformed model is used for all subsequent analyses. If the distribution of residuals remains non-normal after the two types of transformation, the dependent variable is not further analysed.
Homoscedasticity is tested with Breusch–Pagan test.
In case of normal/homoscedastic data, classic type III ANOVA is performed. In case of normal/heteroscedastic data, type III ANOVA with White adjustment is performed.
Factors with a significant effect in ANOVA are further subjected to posthoc test. In case of significant interaction effect(s), only the significant interaction term(s) are subjected to posthoc analysis. For normal/homoscedastic data, posthoc test is performed by comparison of estimated marginal means and one of the following adjustment methods: "tukey", "scheffe", "sidak", "bonferroni", "dunnettx", "mvt", and "none". For normal/heteroscedastic data, posthoc test is performed with Games-Howell test.
A tibble containing, for each dependent variable, an ANOVA and associated posthoc test as well as the corresponding plot.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.