afex_aov-methods: Methods for afex_aov objects

afex_aov-methodsR Documentation

Methods for afex_aov objects

Description

Methods defined for objects returned from the ANOVA functions aov_car et al. of class afex_aov containing both the ANOVA fitted via car::Anova and base R's aov.

Usage

## S3 method for class 'afex_aov'
anova(
  object,
  es = afex_options("es_aov"),
  observed = NULL,
  correction = afex_options("correction_aov"),
  MSE = TRUE,
  intercept = FALSE,
  p_adjust_method = NULL,
  sig_symbols = attr(object$anova_table, "sig_symbols"),
  ...
)

## S3 method for class 'afex_aov'
print(x, ...)

## S3 method for class 'afex_aov'
summary(object, ...)

recover_data.afex_aov(object, ..., model = afex_options("emmeans_model"))

emm_basis.afex_aov(
  object,
  trms,
  xlev,
  grid,
  ...,
  model = afex_options("emmeans_model")
)

Arguments

object, x

object of class afex_aov as returned from aov_car and related functions.

es

Effect Size to be reported. The default is given by afex_options("es_aov"), which is initially set to "ges" (i.e., reporting 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 of the degrees of freedom should be reported for the within-subject factors. The default is given by afex_options("correction_aov"), which is initially set to "GG" corresponding to the Greenhouse-Geisser correction. Possible values are "GG", "HF" (i.e., Hyunh-Feldt correction), and "none" (i.e., no correction).

MSE

logical. Should the column containing the Mean Sqaured Error (MSE) be displayed? Default is TRUE.

intercept

logical. Should intercept (if present) be included in the ANOVA table? Default is FALSE which hides the intercept.

p_adjust_method

character indicating if p-values for individual effects should be adjusted for multiple comparisons (see p.adjust and details).

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 = "" will display the stars but not the +, sig_symbols = rep("", 4) will display no symbols. The default is given by afex_options("sig_symbols").

...

further arguments passed through, see description of return value for details.

model

argument for emmeans() and related functions that allows to choose on which model the follow-up tests for ANOVAs with repeated-measures factors are based. "multivariate" (the default) uses the lm model and "univariate" uses the aov model. Default given by afex_options("emmeans_mode"). Multivariate tests likely work better for unbalanced data and provide a better correction for violations of sphericity.

trms, xlev, grid

same as for emm_basis.

Details

Exploratory ANOVA, for which no detailed hypotheses have been specified a priori, harbor a multiple comparison problem (Cramer et al., 2015). To avoid an inflation of familywise Type I error rate, results need to be corrected for multiple comparisons using p_adjust_method. p_adjust_method defaults to the method specified in the call to aov_car in anova_table. If no method was specified and p_adjust_method = NULL p-values are not adjusted.

Value

anova

Returns an ANOVA table of class c("anova", "data.frame"). Information such as effect size (es) or df-correction are calculated each time this method is called.

summary

For ANOVAs containing within-subject factors it returns the full output of the within-subject tests: the uncorrected results, results containing Greenhousse-Geisser and Hyunh-Feldt correction, and the results of the Mauchly test of sphericity (all achieved via summary.Anova.mlm). For other ANOVAs, the anova table is simply returned.

print

Prints (and invisibly returns) the ANOVA table as constructed from nice (i.e., as strings rounded nicely). Arguments in ... are passed to nice allowing to pass arguments such as es and correction.

recover_data and emm_basis

Provide the backbone for using emmeans and related functions from emmeans directly on afex_aov objects by returning a emmGrid-class object. Should not be called directly but through the functionality provided by emmeans.

References

Cramer, A. O. J., van Ravenzwaaij, D., Matzke, D., Steingroever, H., Wetzels, R., Grasman, R. P. P. P., ... Wagenmakers, E.-J. (2015). Hidden multiplicity in exploratory multiway ANOVA: Prevalence and remedies. Psychonomic Bulletin & Review, 1-8. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3758/s13423-015-0913-5")}

See Also

residuals and fitted methods also exists for afex_aov objects, see: residuals.afex_aov.


afex documentation built on Sept. 11, 2024, 7:59 p.m.