The two main functionalities of afex
are (1) to provide a coherent and intuitive interface to run standard ANOVAs with any number of within- or between-subjects variables (the relevant functions are now called aov_car
, aov_ez
, and aov_4
) and (2) to provide p-values for fixed effects in mixed models using lme4
via function mixed
. The default outputs of those functions can be directly passed to lsmeans
for post-hoc tests or contrasts.
-
afex
is available from CRAN so the current stable version can be installed directly via:install.packages("afex")
-
To install the latest development version you will need the
devtools
package:devtools::install_github("singmann/afex@master")
As of version 0.14
several changes to the interface were introduced:
-
ANOVA functions renamed to
aov_car
,aov_ez
, andaov_4
. Old ANOVA functions are now deprecated. -
new default return argument for ANOVA functions
afex_aov
, an S3 object containing the following:- ANOVA table of class
"anova"
- ANOVA fitted with base R's
aov
(can be passed tolsmeans
for post-hoc tests) - output from
car::Anova
(for tests of effects), ANOVA table 1. is based on this model lm
object passed tocar::Anova
- data used for estimating 2. and 4.
- ANOVA table of class
-
added support for
lsmeans
: objects of classafex_aov
can be passed tolsmeans
directly.afex
now depends onlsmeans
. -
added three new real example data sets and a vignette showing how to calculate contrasts after ANOVA.
-
added
expand_re
argument tomixed
which, ifTRUE
, correctly interprets the||
notation in random effects with factors (i.e., suppresses estimation of correlation among random effects).lmer_alt
is a wrapper formixed
which usesexpand_re = TRUE
, returns an object of classmerMod
(i.e., does not calculate p-values), and otherwise behaves likeg/lmer
(i.e., does not enforce certain contrasts) -
nice.anova
was renamed tonice
(and now also works withmixed
objects). -
Returned objects of
mixed
and the ANOVA functions (i.e., of classafex_aov
) are similar:- Both have a numeric Anova table as first element called
anova_table
(which is of classc("anova", "data.frame")
). - calling
nice
on either returns a nicely rounded Anova table (i.e., numbers converted to characters). This table is also per default printed. - calling
anova
on either will return the numeric Anova table (for which print methods exist as well).
- Both have a numeric Anova table as first element called
-
added
afex_options()
functionality for setting options globally. -
afex
does not depend oncar
package anymore, it is only imported. -
first element in mixed object renamed to
anova_table
. -
summary
method formixed
objects now callssummary.merMod
on full model.