print_anova | R Documentation |
afex
ANOVAPrint the results of an afex
ANOVA
print_anova(afex_object, italic_eta = TRUE, decimals = 2, decimals_p = 3)
afex_object |
An object returned by one of |
italic_eta |
Should the effect size symbol eta be printed in
italic font. Defaults to |
decimals |
How many decimals should be printed for F values and eta-squared. Defaults to 2. |
decimals_p |
How many decimals should be printed for p-values. Defaults to 3. |
To use this function, you have to install the package afex to compute
an ANOVA object, see aov_car
. Pass this object
as the first argument.
According to APA style, the Greek eta symbol - indicating the
effect size in the ANOVA - should be printed in non-italic font.
However, the standard \eta symbol is written in italic. To print a
non-italic eta, use the argument italic_eta = FALSE
. However,
this option requires that you load the Latex package upgreek
in
the YAML header of your R markdown document. To this end, use the following
option in your YAML header:
header-includes: -\usepackage{upgreek}
This option only works for Latex/PDF output.
A list whose elements are strings describing the effects of the ANOVA (main effects and interactions); to be included in an R markdown document.
Martin Papenberg martin.papenberg@hhu.de
Singmann, H., Bolker, B., Westfall, J., & Aust, F. (2019). afex: Analysis of Factorial Experiments. https://CRAN.R-project.org/package=afex
library("afex")
# see ?aov_ez
data(md_12.1)
aov_results <- aov_ez("id", "rt", md_12.1, within = c("angle", "noise"))
print_anova(aov_results)
# Print nonitalic eta, which is required according to APA guidelines
print_anova(aov_results, italic_eta = FALSE)
# Example using other (or no) effect size index
pes <- aov_ez("id", "rt", md_12.1, within = c("angle", "noise"),
anova_table = list(es = "pes"))
print_anova(pes)
print_anova(pes, italic_eta = FALSE)
noes <- aov_ez("id", "rt", md_12.1, within = c("angle", "noise"),
anova_table = list(es = "none"))
print_anova(noes)
## Access individual elements of the ANOVA print list:
aovpr <- print_anova(aov_results, italic_eta = FALSE)
# By index:
aovpr[[1]]
# By name (main effect):
aovpr$angle
aovpr[["angle"]]
# By name (interaction effect, here, the $-notation does not work
# due to non-standard `:` in name):
aovpr[["angle:noise"]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.