View source: R/get_mixed_mod_anova.R
get_mixed_mod_anova | R Documentation |
get_mixed_mod_anova() performs automated ANOVA including random effect(s) and subsequent posthoc test on a set of dependent variables.
get_mixed_mod_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_
)
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) and random factor(s). Must follow the classic formula rules (use "+", "*" and ":" as separators, and see ?lmerTest::lmer for notations of random effects). |
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_. |
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 log transformation and normality of residuals is tested again with Shapiro–Wilk test. Currently, the log-transformed model is used for all subsequent analyses, irrespective of the result of the Shapiro-Wilk test. This should be modified in the future, so that the dependent variable is further analysed only if the distribution of residuals becomes normal after log transformation.
Additionally, normality and homoscedasticity can be graphically inspected through 3 types of plot: residuals vs observed values, fitted values vs residuals, and qq plot.
Type I ANOVA is performed with the Kenward-Roger's approximation to degrees of freedom.
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. 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".
A tibble containing, for each dependent variable, an ANOVA (possibly with random factor) and associated posthoc test as well as the corresponding plot. Also included are residuals vs observed values plot, fitted values vs residuals plot, and qq plot.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.