Learn R Programming

afex (version 0.6-82)

nice.anova: Make nice ANOVA table for printing.

Description

These functions produce a nice ANOVA table best for prointing. nice.anova takes an object from Anova possible created by the convenience functions ez.glm or aov.car. When within-subject factors are present, either sphericity corrected or uncorrected degrees of freedom can be reported.

Usage

nice.anova(object, es = "ges", observed = NULL,
    correction = c("GG", "HF", "none"), MSE = TRUE,
    sig.symbols = c(" +", " *", " **", " ***"))

Arguments

object
An object of class "Anova.mlm" or "anova" as returned from Anova, ez.glm, or aov.car
es
Effect Size to be reported. Default is "ges", which reports generalized eta-squared (see details). Also supported is partial eta-squared ("pes") or "none".
observed
character vector referring to the observed (i.e., non manipulated) variables/effects in the design. Important for calculation of generalized eta-squared (ignored if es is not "ges"), see details.
correction
Character. Which sphericity correction on the degrees of freedom should be reported for the within-subject factors. The default c("GG", "HF", "none") corresponds to the Greenhouse-Geisser correction.
sig.symbols
Character. What should be the symbols designating significance? When entering an vector with length(sig.symbol) < 4 only those elements of the default (c(" +", " *", " **", " ***")) will be replaced. sig.symbols
MSE
logical. Should the column containing the Mean Sqaured Error (MSE) be displayed? Default is TRUE.

Value

  • A data.frame with the ANOVA table consisting of characters. The columns that are always present are: Effect, df (degrees of freedom), F, and p. ges contains the generalized eta-squared effect size measure (Bakeman, 2005), pes contains partial eta-squared (if requested).

Details

The returned data.frame is print-ready when adding to a document with proper methods. I recommend ascii and xtable. ascii provides conversion to http://www.methods.co.nz/asciidoc/{AsciiDoc} but most notably to http://orgmode.org/{org-mode} (see ascii and print-ascii). xtable converts a data.frame into LaTeX code with many possible options (e.g., allowing for "longtable" or "sidewaystable"), see xtable and print.xtable. See Examples. Conversion functions to other formats (such as HTML, ODF, or Word) can be found at the http://cran.r-project.org/web/views/ReproducibleResearch.html{Reproducible Research Task View}. The default reports generalized eta squared (Olejnik & Algina, 2003), the "recommended effect size for repeated measured designs" (Bakeman, 2005). Note that it is important that all measured variables (as opposed to experimentally manipulated variables), such as e.g., age, gender, weight, ..., must be declared via observed to obtain the correct effect size estimate. Partial eta squared ("pes") does not require this.

References

Bakeman, R. (2005). Recommended effect size statistics for repeated measures designs. Behavior Research Methods, 37(3), 379-384. doi:10.3758/BF03192707 Olejnik, S., & Algina, J. (2003). Generalized Eta and Omega Squared Statistics: Measures of Effect Size for Some Common Research Designs. Psychological Methods, 8(4), 434-447. doi:10.1037/1082-989X.8.4.434

See Also

ez.glm and aov.car are the convenience functions to create the object appropriate for nice.anova.

Examples

Run this code
# exampel using obk.long (see ?obk.long), a long version of the OBrienKaiser dataset from car.

data(obk.long)
# create object of class Anova:
tmp.aov <- aov.car(value ~ treatment * gender + Error(id/phase*hour),
             data = obk.long, return = "Anova")

nice.anova(tmp.aov, observed = "gender")

nice.anova(tmp.aov, observed = "gender", sig.symbol = rep("", 4))

# use package ascii or xtable for formatting of tables ready for printing.

full <- nice.anova(tmp.aov, observed = "gender")

require(ascii)
print(ascii(full, include.rownames = FALSE, caption = "ANOVA 1"), type = "org")

require(xtable)
print.xtable(xtable(full, caption = "ANOVA 2"), include.rownames = FALSE)

Run the code above in your browser using DataLab