apa_print.aov {papaja}R Documentation

Typeset Statistical Results from ANOVA

Description

These methods take objects from various R functions that calculate ANOVA to create formatted character strings to report the results in accordance with APA manuscript guidelines. For anova-objects from model comparisons see apa_print.list.

Usage

## S3 method for class 'aov'
apa_print(
  x,
  estimate = getOption("papaja.estimate_anova", "ges"),
  observed = NULL,
  intercept = FALSE,
  mse = TRUE,
  in_paren = FALSE,
  ...
)

## S3 method for class 'summary.aov'
apa_print(
  x,
  estimate = getOption("papaja.estimate_anova", "ges"),
  observed = NULL,
  intercept = FALSE,
  mse = TRUE,
  in_paren = FALSE,
  ...
)

## S3 method for class 'aovlist'
apa_print(
  x,
  estimate = getOption("papaja.estimate_anova", "ges"),
  observed = NULL,
  intercept = FALSE,
  mse = TRUE,
  in_paren = FALSE,
  ...
)

## S3 method for class 'summary.aovlist'
apa_print(
  x,
  estimate = getOption("papaja.estimate_anova", "ges"),
  observed = NULL,
  intercept = FALSE,
  mse = TRUE,
  in_paren = FALSE,
  ...
)

## S3 method for class 'Anova.mlm'
apa_print(
  x,
  estimate = getOption("papaja.estimate_anova", "ges"),
  observed = NULL,
  correction = getOption("papaja.sphericity_correction"),
  intercept = FALSE,
  mse = TRUE,
  in_paren = FALSE,
  ...
)

## S3 method for class 'summary.Anova.mlm'
apa_print(
  x,
  estimate = getOption("papaja.estimate_anova", "ges"),
  observed = NULL,
  correction = getOption("papaja.sphericity_correction"),
  intercept = FALSE,
  mse = TRUE,
  in_paren = FALSE,
  ...
)

## S3 method for class 'afex_aov'
apa_print(
  x,
  estimate = getOption("papaja.estimate_anova", "ges"),
  observed = NULL,
  correction = getOption("papaja.sphericity_correction"),
  intercept = FALSE,
  mse = TRUE,
  in_paren = FALSE,
  ...
)

## S3 method for class 'anova'
apa_print(
  x,
  estimate = getOption("papaja.estimate_anova", "ges"),
  observed = NULL,
  intercept = FALSE,
  mse = TRUE,
  in_paren = FALSE,
  ...
)

## S3 method for class 'manova'
apa_print(x, test = "Pillai", in_paren = FALSE, ...)

## S3 method for class 'summary.manova'
apa_print(x, in_paren = FALSE, ...)

Arguments

x

An object containing the results from an analysis of variance ANOVA

estimate

Character, function, or data frame. Determines which estimate of effect size is to be used. See details.

observed

Character. The names of the factors that are observed, i.e., not manipulated. Necessary only for calculating generalized eta squared; otherwise ignored. If x is of class afex_aov, observed is automatically deduced from x.

intercept

Logical. Indicates if the intercept term should be included in output.

mse

Logical. Indicates if mean squared errors should be included in output. The default is TRUE, but this can be changed either by supplying a different value in the function call or by changing the global default via options(papaja.mse = FALSE).

in_paren

Logical. Whether the formatted string is to be reported in parentheses. If TRUE, parentheses in the formatted string (e.g., those enclosing degrees of freedom) are replaced with brackets.

...

Further arguments that may be passed to apa_num to format estimates (i.e., columns estimate and conf.int).

correction

Character. For repeated-measures ANOVA, the type of sphericity correction to be used. Possible values are "GG" for the Greenhouse-Geisser method (the default), "HF" for the Huyn-Feldt method, or "none" for no correction.

test

Character. For MANOVA, the multivariate test statistic to be reported, see summary.manova.

Details

The factor names are sanitized to facilitate their use as list names (see Value section). Parentheses are omitted and other non-word characters are replaced by ⁠_⁠.

Argument estimate determines which measure of effect size is to be used: It is currently possible to provide one of three characters to specify the to-be-calculated effect size: "ges" for generalized eta^2, "pes" for partial eta^2, and "es" for eta^2. Note that eta^2 is calculated correctly if and only if the design is balanced.

It is also possible to provide a data.frame with columns estimate, conf.low, and conf.high, which allows for including custom effect- size measures.

A third option is to provide a function from the effectsize package that will be used to calculate effect-size measures from x. If effectsize is installed (and papaja is loaded), this is the new default. This default can be changed via options(papaja.estimate_anova = ...).

Value

apa_print()-methods return a named list of class apa_results containing the following elements:

estimate

One or more character strings giving point estimates, confidence intervals, and confidence level. A single string is returned in a vector; multiple strings are returned as a named list. If no estimate is available the element is NULL.

statistic

One or more character strings giving the test statistic, parameters (e.g., degrees of freedom), and p-value. A single string is returned in a vector; multiple strings are returned as a named list. If no estimate is available the element is NULL.

full_result

One or more character strings comprised 'estimate' and 'statistic'. A single string is returned in a vector; multiple strings are returned as a named list.

table

A data.frame of class apa_results_table that contains all elements of estimate and statistics. This table can be passed to apa_table() for reporting.

Column names in apa_results_table are standardized following the broom glossary (e.g., term, estimate conf.int, statistic, df, df.residual, p.value). Additionally, each column is labelled (e.g., $\hat{\eta}^2_G$ or $t$) using the tinylabels package and these labels are used as column names when an apa_results_table is passed to apa_table().

References

Bakeman, R. (2005). Recommended effect size statistics for repeated measures designs. Behavior Research Methods , 37 (3), 379–384. doi: doi:10.3758/BF03192707

See Also

aov(), car::Anova(), apa_print.list()

Other apa_print: apa_print.BFBayesFactor(), apa_print.emmGrid(), apa_print.glht(), apa_print.htest(), apa_print.list(), apa_print.lme(), apa_print.lm(), apa_print.merMod(), apa_print()

Examples

   ## From Venables and Ripley (2002) p. 165.
   npk_aov <- aov(yield ~ block + N * P * K, npk)
   apa_print(npk_aov)

   # Use the effectsize package to calculate partial eta-squared with
   # confidence intervals
   apa_print(npk_aov, estimate = effectsize::omega_squared)

[Package papaja version 0.1.2 Index]