[r-cran-afex] 07/09: Imported Upstream version 0.16-1

Jonathon Love jon at thon.cc
Thu Apr 21 08:50:35 UTC 2016


This is an automated email from the git hooks/post-receive script.

jonathon-guest pushed a commit to branch master
in repository r-cran-afex.

commit 304ec57a37dcea9a19afc5ea6bb4f52a302faa1d
Author: Jonathon Love <jon at thon.cc>
Date:   Thu Apr 21 18:34:24 2016 +1000

    Imported Upstream version 0.16-1
---
 DESCRIPTION                              |  45 ++++++++++--------
 MD5                                      |  79 ++++++++++++++++---------------
 NAMESPACE                                |   3 +-
 NEWS                                     |  28 +++++++++++
 R/afex-package.R                         |   8 ++--
 R/allFit.R                               |  13 +----
 R/aov_car.R                              |  15 +++---
 R/helpers.R                              |   3 +-
 R/methods.afex_aov.R                     |  23 +++++----
 R/mixed.R                                |  20 +++++---
 R/nice.R                                 |  50 +++++++++++++++----
 R/set_contrasts.R                        |   1 -
 build/vignette.rds                       | Bin 262 -> 263 bytes
 inst/doc/anova_posthoc.html              |  49 ++++++++++++-------
 man/afex-package.Rd                      |  10 ++--
 man/afex_aov-methods.Rd                  |   8 ++--
 man/afex_options.Rd                      |   5 +-
 man/allFit.Rd                            |  24 +++++++++-
 man/aov_car.Rd                           |  61 ++++++++++++++----------
 man/compare.2.vectors.Rd                 |  18 +++----
 man/deprecated.Rd                        |   4 +-
 man/ems.Rd                               |  10 ++--
 man/ks2013.3.Rd                          |   2 +-
 man/md_12.1.Rd                           |  38 ++++++++-------
 man/md_15.1.Rd                           |   3 +-
 man/md_16.1.Rd                           |   3 +-
 man/md_16.4.Rd                           |   4 +-
 man/mixed.Rd                             |  13 +++--
 man/nice.Rd                              |  24 ++++++----
 man/obk.long.Rd                          |   2 +-
 man/round_ps.Rd                          |   3 +-
 man/set_sum_contrasts.Rd                 |   2 +-
 man/sk2011.1.Rd                          |  12 +++--
 man/sk2011.2.Rd                          |   2 +-
 tests/testthat/lmm_old_object.rda        | Bin 0 -> 221770 bytes
 tests/testthat/test-aov_car-bugs.R       |  14 ++++--
 tests/testthat/test-aov_car-structural.R |  40 ++++++++++++++++
 tests/testthat/test-compare_2_vectors.R  |   3 +-
 tests/testthat/test-lsmeans-interface.R  |   8 ++--
 tests/testthat/test-mixed-bugs.R         |  20 ++++++++
 tests/testthat/test-mixed-structure.R    |  64 ++++++++++++++++++-------
 41 files changed, 482 insertions(+), 252 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 85eb577..7e8dad0 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,39 +1,42 @@
 Package: afex
 Type: Package
 Title: Analysis of Factorial Experiments
-Depends: R (>= 3.0.0), lme4 (>= 1.0.5), reshape2, lsmeans (>= 2.17)
+Depends: R (>= 3.1.0), lme4 (>= 1.1-8), reshape2, lsmeans (>= 2.17)
 Suggests: ascii, xtable, parallel, plyr, optimx, nloptr, knitr,
         lattice, multcomp, testthat, mlmRev, dplyr
-Imports: stringr, coin, Matrix, pbkrtest (>= 0.3-6), car, stats, utils,
-        methods
-Description: Provides convenience functions for analyzing factorial experiments using ANOVA or mixed models. aov_ez(),
-              aov_car(), and aov_4() allow specification of between, within (i.e., repeated-measures), or mixed between-within
-              (i.e., split-plot) ANOVAs for data in long format (i.e., one observation per row), potentially aggregating
-              multiple observations per individual and cell of the design. mixed() fits mixed models using lme4::lmer() and
-              computes p-values for all fixed effects using either Kenward-Roger approximation for degrees of freedom (LMM
-              only), parametric bootstrap (LMMs and GLMMs), or likelihood ratio tests (LMMs and GLMMs). afex uses type 3 sums
-              of squares as default (imitating commercial statistical software).
+Imports: stringr, coin, Matrix (>= 1.1.1), pbkrtest (>= 0.4-1), car,
+        stats, utils, methods
+Description: Provides convenience functions for analyzing factorial
+    experiments using ANOVA or mixed models. aov_ez(), aov_car(), and aov_4() allow
+    specification of between, within (i.e., repeated-measures), or mixed between-
+    within (i.e., split-plot) ANOVAs for data in long format (i.e., one observation
+    per row), potentially aggregating multiple observations per individual and
+    cell of the design. mixed() fits mixed models using lme4::lmer() and computes
+    p-values for all fixed effects using either Kenward-Roger approximation for
+    degrees of freedom (LMM only), parametric bootstrap (LMMs and GLMMs), or
+    likelihood ratio tests (LMMs and GLMMs). afex uses type 3 sums of squares as
+    default (imitating commercial statistical software).
 URL: https://github.com/singmann/afex
 License: GPL (>= 3)
 Encoding: UTF-8
 VignetteBuilder: knitr
-Authors at R: c(person(given="Henrik", family="Singmann", role=c("aut", "cre"), email="singmann+afex at gmail.com"),
-              person(given="Ben", family="Bolker", role=c("aut")), person(given="Jake", family="Westfall", role=c("aut")),
-              person(given="Søren", family="Højsgaard", role=c("ctb")), person(given="John", family="Fox", role=c("ctb")),
-              person(given="Michael A.", family="Lawrence", role=c("ctb")), person(given="Ulf", family="Mertens",
-              role=c("ctb")), person(given="Frederik", family="Aust", role=c("ctb")) )
-Version: 0.15-2
-Date: 2015-10-24
+Authors at R: c(person(given="Henrik", family="Singmann", role=c("aut", "cre"), email="singmann+afex at gmail.com"), person(given="Ben", family="Bolker",
+                  role=c("aut")), person(given="Jake", family="Westfall", role=c("aut")), person(given="Frederik", family="Aust", role=c("aut")),
+                  person(given="Søren", family="Højsgaard", role=c("ctb")), person(given="John", family="Fox", role=c("ctb")), person(given="Michael A.",
+                  family="Lawrence", role=c("ctb")), person(given="Ulf", family="Mertens", role=c("ctb")) )
+Version: 0.16-1
+Date: 2016-04-04
+RoxygenNote: 5.0.1
 NeedsCompilation: no
-Packaged: 2015-10-24 21:30:01 UTC; henrik
+Packaged: 2016-04-03 22:10:13 UTC; henrik
 Author: Henrik Singmann [aut, cre],
   Ben Bolker [aut],
   Jake Westfall [aut],
+  Frederik Aust [aut],
   Søren Højsgaard [ctb],
   John Fox [ctb],
   Michael A. Lawrence [ctb],
-  Ulf Mertens [ctb],
-  Frederik Aust [ctb]
+  Ulf Mertens [ctb]
 Maintainer: Henrik Singmann <singmann+afex at gmail.com>
 Repository: CRAN
-Date/Publication: 2015-10-25 00:22:33
+Date/Publication: 2016-04-04 01:11:31
diff --git a/MD5 b/MD5
index db64456..67cef39 100644
--- a/MD5
+++ b/MD5
@@ -1,28 +1,28 @@
-60b38a293c403e36a90d34341dd903cf *DESCRIPTION
-160258847a0a157239251c3f2f9dfd8a *NAMESPACE
-ac52367f70c85a636c2c0689b669682b *NEWS
-7bb865039d9dadd48badd0aa906d1c06 *R/afex-package.R
-e31ce0d5d4da04c14e2a30f6c6c75e6b *R/allFit.R
-8cbd1c613dfbe922989bc01bbba61b55 *R/aov_car.R
+1e984e59a017b1609bb0cc1cb36cf2b0 *DESCRIPTION
+2aeb286531e10f1e75317b07cd1757fd *NAMESPACE
+1e0ea9ed3fbd472f560151ce356e1630 *NEWS
+b62e7e3a8cc88b042bfaa5f329b18ae7 *R/afex-package.R
+e7ca2fea679d5a08424632beff460412 *R/allFit.R
+78a5ba411a27db110b533d04766d0378 *R/aov_car.R
 03bb0e49814a31c17b98561e308c652a *R/compare.2.vectors.R
 9641356efdc58afcb325fd52536eb467 *R/deprecated.R
 87bf02eab351c8d2f1eb6cd081db6630 *R/ems.R
-fbb9cc1bede5cc2db4a8f9ab261d1d55 *R/helpers.R
+607a9fda443d01611c65ff16d2787fab *R/helpers.R
 f35751ee0dfdeb49847da1c0e2ba6658 *R/ks2013.3-data.R
 d9a78c053bf03e0cf991c45584216bea *R/md_12.1-data.R
 37d9937eb76fd7c19d4cca73e39832b3 *R/md_15.1-data.R
 51eacd95f1dc5216b88df8e71eed8738 *R/md_16.1-data.R
 e727b7435149abb02c94bff9ce930edd *R/md_16.4-data.R
-1535623b79e79b2a3f5699951d99d61b *R/methods.afex_aov.R
-492a81a1b9b3b0df0b2e4ced083ac7bf *R/mixed.R
-e81f3c225e8838c5aff116cc3c76b4fd *R/nice.R
+eda749243e30316680133b1149a8674a *R/methods.afex_aov.R
+c01191e2be2fbc4d3a4a617d07e23593 *R/mixed.R
+8bf2b728d1cd6af09aaf7e8ae894a7e0 *R/nice.R
 6957d204d984fc4bc9fd8d9a171af7bc *R/obk.long-data.R
 f03bbeccea307b186df307433c31e455 *R/round_ps.R
-a63da9c14316068adbc27738bd2dd327 *R/set_contrasts.R
+c81f47ce71a4c47fc01bfd145e338e13 *R/set_contrasts.R
 8bb208f001aff1425bb8ebb5a4fb465e *R/sk2011.1-data.R
 9fe8b5e4ad58e9350525f1a88f300e37 *R/sk2011.2-data.R
 05d70dfe85c65b258f18dd62cb3db36b *R/zzz.R
-7adc8fd6a7eb8f38c8336b96c42bee56 *build/vignette.rds
+fa8b647ff75f15b55826847518bbe878 *build/vignette.rds
 dc520acd438387964b4561483968f18e *data/ks2013.3.rda
 4df2c0c2a5a52ff004bd015e90f8e328 *data/md_12.1.rda
 5722056139ad1750e737931076c518d2 *data/md_15.1.rda
@@ -33,35 +33,36 @@ dbe295d0e59a0fd4cf4b73965ddfd16b *data/md_16.4.rda
 30d68b1cca41bab8e71a24b7b48489be *data/sk2011.2.rda
 027e65f8b7a11dd648eb93b1f55d33d3 *inst/doc/anova_posthoc.R
 4364559dfa702f5231977f187a7bda97 *inst/doc/anova_posthoc.Rmd
-fba28f50137f002941ab4fc7d7c0e3c2 *inst/doc/anova_posthoc.html
-b12e57333793bdab7da8b887dca46ca1 *man/afex-package.Rd
-de67c42a49e6b7d295117ea5bcb59234 *man/afex_aov-methods.Rd
-1806e552994252b6e21c68a96cedde26 *man/afex_options.Rd
-0ff09ac2bb7983163cce41711bb352a2 *man/allFit.Rd
-7eba0fd3eb67aece214c9dd996d11e17 *man/aov_car.Rd
-7c3c61fbd0294014517feac2337fef95 *man/compare.2.vectors.Rd
-48242aa2c2a836194b2ed899a35c8bf4 *man/deprecated.Rd
-64b725f5c7eb2ab1e0059cb6065461ae *man/ems.Rd
-e67065f167584eaa76213bf5ca74db3d *man/ks2013.3.Rd
-494fb12efcb882460b68a54f45c3964b *man/md_12.1.Rd
-c4315f524d2f432e26764644952fe243 *man/md_15.1.Rd
-b0bf1c627ee56fca0024c8caeaa89e8f *man/md_16.1.Rd
-46abbb31e2629f98b4ccc226fd858ee7 *man/md_16.4.Rd
-45e34ee8faac149515e08882355b10ae *man/mixed.Rd
-30460c25fef3a60976dc13dc45f3d3cb *man/nice.Rd
-05611b26ef5504b3bcdcb537048e93b8 *man/obk.long.Rd
-166500ffec6b75c0a22fc5def73c48f2 *man/round_ps.Rd
-945c59d7b49801f33eaa82f924c9db12 *man/set_sum_contrasts.Rd
-7be172f5999a2193bda6edd1ce39377c *man/sk2011.1.Rd
-aed1a982e81e640dea0b383ee389c958 *man/sk2011.2.Rd
+82177a87db4f0791f476102cd4f7f017 *inst/doc/anova_posthoc.html
+e23b352120649f28c4b194f728559850 *man/afex-package.Rd
+cf7e37c45ab62b04eb7be2004fd59ac4 *man/afex_aov-methods.Rd
+47c1c98792ceb04ce44b21aa95089ee4 *man/afex_options.Rd
+08e71a543438ab34b39eb9029f182472 *man/allFit.Rd
+e02092b5c0ae04026cc992b3e4141383 *man/aov_car.Rd
+e5830db34410f06b587b87245f9f4ae0 *man/compare.2.vectors.Rd
+3bd662bf3d8f6a0cee0fa1a86066bfb9 *man/deprecated.Rd
+ec0030d9ed512be18da845219e4e8a90 *man/ems.Rd
+2343237382934a17c5f8a6510aba52cb *man/ks2013.3.Rd
+af5f072efee2a3074b2edb1c9d8ba825 *man/md_12.1.Rd
+744afdc4bc32bdfd604af632c00eeed2 *man/md_15.1.Rd
+eb5ae9eddb0792f14c1b172733a99b8e *man/md_16.1.Rd
+e624ba98be81654ca569d3c82500b404 *man/md_16.4.Rd
+1df3de6af3a17875d521198c40afae84 *man/mixed.Rd
+6595f645adb0c58ad346c068c4517d07 *man/nice.Rd
+e903be860c845447b1f9c9305b28027f *man/obk.long.Rd
+19b77857f22b0e23ffa949c83f3e44e0 *man/round_ps.Rd
+83bd4d01de62e76b61dea027643ca581 *man/set_sum_contrasts.Rd
+b7c5bd6f53367e102ead931fc76c6572 *man/sk2011.1.Rd
+34e18e69e2b3fd9a3156adbb3fcf1f41 *man/sk2011.2.Rd
 2d343f0d270a71a9cf1a10b3c6bf200b *tests/testthat.R
+8e1d7042dd7d30ae9eb8734f0080e5bd *tests/testthat/lmm_old_object.rda
 7499da384eba0654fa73adf761124e50 *tests/testthat/test-afex_aov.R
 e0643d83228db1d514e856d349cdc2fa *tests/testthat/test-aov_car-basic.R
-fad3cd44ee03f26c3bd9bdc0dbf016ea *tests/testthat/test-aov_car-bugs.R
-354f395ebba3da7cd2fe66dbf6658b4c *tests/testthat/test-aov_car-structural.R
-552bc7ee76d8eac9745073052962a11f *tests/testthat/test-compare_2_vectors.R
-a4d70d487b537c7bc34dc2641bf50f00 *tests/testthat/test-lsmeans-interface.R
-8bfccda7b9c2b528eb2bad66eca19b50 *tests/testthat/test-mixed-bugs.R
+792d31971d91229555b493e92f260134 *tests/testthat/test-aov_car-bugs.R
+42e9c675717b79dc12ee99355a9428c0 *tests/testthat/test-aov_car-structural.R
+abd3af78e5b91665be7b3e386f86e724 *tests/testthat/test-compare_2_vectors.R
+634ca98f15cdf593ca161f95a01d79d8 *tests/testthat/test-lsmeans-interface.R
+372e6e44867da1755a347f051a624ffc *tests/testthat/test-mixed-bugs.R
 03f06b1890cd568eedd0001becfdede0 *tests/testthat/test-mixed-mw.R
-77f8ead26cccf055c9fcf14bcd3edae2 *tests/testthat/test-mixed-structure.R
+3ed3048894e89b476176c63022b5ca37 *tests/testthat/test-mixed-structure.R
 4364559dfa702f5231977f187a7bda97 *vignettes/anova_posthoc.Rmd
diff --git a/NAMESPACE b/NAMESPACE
index 76944b4..074d792 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -1,4 +1,4 @@
-# Generated by roxygen2 (4.1.1): do not edit by hand
+# Generated by roxygen2: do not edit by hand
 
 S3method(anova,afex_aov)
 S3method(anova,mixed)
@@ -9,6 +9,7 @@ S3method(nice,anova)
 S3method(nice,mixed)
 S3method(print,afex_aov)
 S3method(print,mixed)
+S3method(print,nice_table)
 S3method(recover.data,afex_aov)
 S3method(recover.data,mixed)
 S3method(summary,afex_aov)
diff --git a/NEWS b/NEWS
index 107a5bd..12412bb 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,32 @@
                     *************************
+                    ** afex VERSION 0.16-x **
+                    *************************
+                    
+                    Changes in afex Version 0.16-x
+                    Released April 2016
+
+    Significant User Visible Changes and New Features
+
+    o   added "correction" and "observed" attributes to the anova_table slot of
+        afex_aov objects, which is used per default by nice(). This ensures 
+        that nice(object) and object always return the same data.frame.
+        Also added "nice_table" class to data.frame returned by nice which 
+        print the value of the slopts for information.
+        Both contributed by Frederik Aust (who was also promoted to author).
+        
+    o   added return="data" for mixed. This allows to obtain the data set used
+        for fitting a model. Can be useful in combination with expand.re=TRUE 
+        and allFit() or for obtaining predictions. See ?allFit for a simple 
+        example.
+        
+    Bugfixes
+    
+    o   increased required version of R (>= 3.1.0) and the following packages
+        to ensure afex runs with older versions of R: lme4 (>= 1.1-8), 
+        pbkrtest (>= 0.4-1), and Matrix (>= 1.1.1).
+
+        
+                    *************************
                     ** afex VERSION 0.15-x **
                     *************************
                     
diff --git a/R/afex-package.R b/R/afex-package.R
index 6f2c160..695874d 100644
--- a/R/afex-package.R
+++ b/R/afex-package.R
@@ -3,9 +3,9 @@
 #' \tabular{ll}{
 #' Package: \tab afex\cr
 #' Type: \tab Package\cr
-#' Version: \tab 0.15-2\cr
-#' Date: \tab 2015-10-24\cr
-#' Depends: \tab R (>= 3.0.0), lme4 (>= 1.0.5), reshape2, lsmeans (>= 2.17)\cr
+#' Version: \tab 0.16-1\cr
+#' Date: \tab 2016-04-04\cr
+#' Depends: \tab R (>= 3.1.0), lme4 (>= 1.1-8), reshape2, lsmeans (>= 2.17)\cr
 #' Encoding: \tab UTF-8\cr
 #' License: \tab GPL (>=3)\cr
 #' URL: \tab https://github.com/singmann/afex\cr
@@ -17,6 +17,6 @@
 #' @name afex-package
 #' @docType package
 #' @title The afex Package
-#' @author Henrik Singmann, Ben Bolker, Jake Westfall, with contributions from Søren Højsgaard, John Fox, Michael A. Lawrence, Ulf Mertens, Frederik Aust
+#' @author Henrik Singmann, Ben Bolker, Jake Westfall, Frederik Aust, with contributions from Søren Højsgaard, John Fox, Michael A. Lawrence, Ulf Mertens
 #' @keywords package
 NULL
diff --git a/R/allFit.R b/R/allFit.R
index 7794493..b35394a 100644
--- a/R/allFit.R
+++ b/R/allFit.R
@@ -27,17 +27,8 @@
 #' @export 
 #' @importFrom lme4 isGLMM lmerControl glmerControl
 #' @importFrom stats setNames update
-#' @examples
-#' \dontrun{
-#' require(optimx)
-#' gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
-#' data = cbpp, family = binomial)
-#' gm_all <- allFit(gm1)
-#' t(sapply(gm_all,fixef)) ## extract fixed effects
-#' sapply(gm_all,logLik) ## log-likelihoods
-#' sapply(gm_all,getME,"theta") ## theta parameters
-#' !sapply(gm_all,inherits,"try-error") ## was fit OK?
-#' }
+#' 
+#' @example examples/examples.allFit.R
 #' 
 allFit <- function(m, meth.tab = cbind(optimizer=rep(c("bobyqa","Nelder_Mead", "optimx", "nloptwrap"),                                             c( 1, 1, 2, 2)),method= c("", "", "nlminb","L-BFGS-B","NLOPT_LN_NELDERMEAD", "NLOPT_LN_BOBYQA")),verbose=TRUE,maxfun=1e5, ...)
 {
diff --git a/R/aov_car.R b/R/aov_car.R
index e063d82..03b34ef 100644
--- a/R/aov_car.R
+++ b/R/aov_car.R
@@ -121,7 +121,9 @@
 #'
 #' \code{\link{mixed}} provides a (formula) interface for obtaining p-values for mixed-models via \pkg{lme4}.
 #'
-#' @references Maxwell, S. E., & Delaney, H. D. (2004). \emph{Designing Experiments and Analyzing Data: A Model-Comparisons Perspective}. Mahwah, N.J.: Lawrence Erlbaum Associates.
+#' @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.  \emph{Psychonomic Bulletin & Review}, 1–8. doi:\href{http://doi.org/10.3758/s13423-015-0913-5}{10.3758/s13423-015-0913-5} 
+#' 
+#' Maxwell, S. E., & Delaney, H. D. (2004). \emph{Designing Experiments and Analyzing Data: A Model-Comparisons Perspective}. Mahwah, N.J.: Lawrence Erlbaum Associates.
 #'
 #' Venables, W.N. (2000). \emph{Exegeses on linear models}. Paper presented to the S-Plus User's Conference, Washington DC, 8-9 October 1998, Washington, DC. Available from: \url{http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf}
 #'
@@ -184,7 +186,7 @@ aov_car <- function(formula, data, fun.aggregate = NULL, type = afex_options("ty
     c.ns <- between[vapply(data[, between, drop = FALSE], is.numeric, TRUE)]
     if (length(c.ns) > 0) {
       non.null <- c.ns[!abs(vapply(data[, c.ns, drop = FALSE], mean, 0)) < .Machine$double.eps ^ 0.5]
-      if (length(non.null) > 0) warning(str_c("Numerical variables NOT centered on 0 (i.e., likely bogus results): ", str_c(non.null, collapse = ", ")))
+      if (length(non.null) > 0) warning(str_c("Numerical variables NOT centered on 0 (i.e., likely bogus results): ", str_c(non.null, collapse = ", ")), call. = FALSE)
     }
   }
   for (i in c(between, within)) {
@@ -211,7 +213,7 @@ aov_car <- function(formula, data, fun.aggregate = NULL, type = afex_options("ty
   # Is fun.aggregate NULL and aggregation necessary?
   if (is.null(fun.aggregate)) {
     if (any(xtabs(as.formula(str_c("~", id, if (length(within) > 0) "+", rh1)), data = data) > 1)) {
-      warning("More than one observation per cell, aggregating the data using mean (i.e, fun.aggregate = mean)!")
+      warning("More than one observation per cell, aggregating the data using mean (i.e, fun.aggregate = mean)!", call. = FALSE)
       fun.aggregate <- mean
     }
   } 
@@ -228,7 +230,7 @@ aov_car <- function(formula, data, fun.aggregate = NULL, type = afex_options("ty
   # check for missing values:
   if (any(is.na(tmp.dat))) {
     missing.values <- apply(tmp.dat, 1, function(x) any(is.na(x)))
-    warning(str_c("Missing values for following ID(s):\n", str_c(tmp.dat[missing.values,1], collapse = ", "), "\nRemoving those cases from the analysis."))        
+    warning(str_c("Missing values for following ID(s):\n", str_c(tmp.dat[missing.values,1], collapse = ", "), "\nRemoving those cases from the analysis."), call. = FALSE)        
   }
   #   if (length(between) > 0) {
   #     n_data_points <- xtabs(as.formula(paste("~", paste(between, collapse = "+"))), data = tmp.dat)
@@ -275,7 +277,7 @@ aov_car <- function(formula, data, fun.aggregate = NULL, type = afex_options("ty
           }
         }
       }
-      if((type == 3 | type == "III") && (length(non_sum_contrast)>0)) warning(str_c("Calculating Type 3 sums with contrasts != 'contr.sum' for: ", paste0(non_sum_contrast, collapse=", "), "\n  Results likely bogus or not interpretable!\n  You probably want check.contrasts = TRUE or options(contrasts=c('contr.sum','contr.poly'))"))
+      if((type == 3 | type == "III") && (length(non_sum_contrast)>0)) warning(str_c("Calculating Type 3 sums with contrasts != 'contr.sum' for: ", paste0(non_sum_contrast, collapse=", "), "\n  Results likely bogus or not interpretable!\n  You probably want check.contrasts = TRUE or options(contrasts=c('contr.sum','contr.poly'))"), call. = FALSE)
     }
   }
   if (return %in% c("aov", "afex_aov")) include.aov <- TRUE
@@ -335,7 +337,8 @@ aov_car <- function(formula, data, fun.aggregate = NULL, type = afex_options("ty
   }
   if (return == "Anova") return(Anova.out)
   else if (return == "univariate") {
-    if (class(Anova.out) == "Anova.mlm") return(summary(Anova.out, multivariate = FALSE))
+    #if (class(Anova.out) == "Anova.mlm") return(summary(Anova.out, multivariate = FALSE))
+    if (inherits(Anova.out, "Anova.mlm")) return(summary(Anova.out, multivariate = FALSE))
     else return(Anova.out)
   }
   else if (return == "nice") {
diff --git a/R/helpers.R b/R/helpers.R
index 5abaec1..e645a54 100644
--- a/R/helpers.R
+++ b/R/helpers.R
@@ -30,8 +30,7 @@
 #' 
 #' @importFrom utils ls.str
 #' 
-#' @export 
-#' 
+#' @export
 
 afex_options <- function(...)
 {
diff --git a/R/methods.afex_aov.R b/R/methods.afex_aov.R
index c2fc08c..561ae87 100644
--- a/R/methods.afex_aov.R
+++ b/R/methods.afex_aov.R
@@ -37,7 +37,8 @@ anova.afex_aov <- function(object, es = afex_options("es_aov"), observed = NULL,
   # check arguments
   es <- match.arg(es, c("none", "ges", "pes"), several.ok = TRUE)
   correction <- match.arg(correction, c("GG", "HF", "none"))
-  if (class(object$Anova)[1] == "Anova.mlm") {
+  #if (class(object$Anova)[1] == "Anova.mlm") {
+  if (inherits(object$Anova, "Anova.mlm")) {
     tmp <- suppressWarnings(summary(object$Anova, multivariate = FALSE))
     t.out <- tmp[["univariate.tests"]]
     #browser()
@@ -49,7 +50,7 @@ anova.afex_aov <- function(object, es = afex_options("es_aov"), observed = NULL,
       t.out[row.names(tmp[["pval.adjustments"]]), "Pr(>F)"] <- tmp[["pval.adjustments"]][,"Pr(>F[GG])"]
     } else {
       if (correction[1] == "HF") {
-        if (any(tmp[["pval.adjustments"]][,"HF eps"] > 1)) warning("HF eps > 1 treated as 1")
+        if (any(tmp[["pval.adjustments"]][,"HF eps"] > 1)) warning("HF eps > 1 treated as 1", call. = FALSE)
         tmp[["pval.adjustments"]] <- tmp[["pval.adjustments"]][!is.na(tmp[["pval.adjustments"]][,"HF eps"]),, drop = FALSE]
         t.out[row.names(tmp[["pval.adjustments"]]), "num Df"] <- t.out[row.names(tmp[["pval.adjustments"]]), "num Df"] * pmin(1, tmp[["pval.adjustments"]][,"HF eps"])
         t.out[row.names(tmp[["pval.adjustments"]]), "den Df"] <- t.out[row.names(tmp[["pval.adjustments"]]), "den Df"] * pmin(1, tmp[["pval.adjustments"]][,"HF eps"])
@@ -62,7 +63,8 @@ anova.afex_aov <- function(object, es = afex_options("es_aov"), observed = NULL,
     }
     tmp.df <- t.out    
     tmp2 <- as.data.frame(unclass(tmp.df))
-  } else if (class(object$Anova)[1] == "anova") {
+  #} else if (class(object$Anova)[1] == "anova") {
+  } else if (inherits(object$Anova, "anova")) {
     #browser()
     tmp.df <- cbind(object$Anova[-nrow(object$Anova),], data.frame("Error SS" = object$Anova[nrow(object$Anova), "Sum Sq"], "den Df" = object$Anova[nrow(object$Anova), "Df"], check.names = FALSE))
     colnames(tmp.df)[1:3] <- c("SS", "num Df", "F")
@@ -77,7 +79,7 @@ anova.afex_aov <- function(object, es = afex_options("es_aov"), observed = NULL,
   }
   if ("ges" %in% es) {
     # This code is basically a copy from ezANOVA by Mike Lawrence!
-    if(!is.null(observed)){
+    if(!is.null(observed) & length(observed) > 0){
       obs <- rep(FALSE,nrow(tmp2))
       for(i in observed){
         if (!any(str_detect(rownames(tmp2),str_c("\\b",i,"\\b")))) stop(str_c("Observed variable not in data: ", i))
@@ -92,15 +94,18 @@ anova.afex_aov <- function(object, es = afex_options("es_aov"), observed = NULL,
     es_df$ges <- tmp2$SS/(tmp2$SS+sum(unique(tmp2[,"Error SS"]))+obs_SSn1-obs_SSn2)
   }
   anova_table <- cbind(tmp2[,c("num Df", "den Df", "MSE", "F")], es_df, "Pr(>F)" = tmp2[,c("Pr(>F)")])
-  class(anova_table) <- c("anova", "data.frame")
-  attr(anova_table, "heading") <- c(paste0("Anova Table (Type ", object$information$type , " tests)\n"), paste("Response:", object$information$dv))
   #browser()
   if (!MSE) anova_table$MSE <- NULL 
   if (!intercept) if (row.names(anova_table)[1] == "(Intercept)")  anova_table <- anova_table[-1,, drop = FALSE]
   # Correct for multiple comparisons
   if(is.null(p.adjust.method)) p.adjust.method <- ifelse(is.null(attr(object$anova_table, "p.adjust.method")), "none", attr(object$anova_table, "p.adjust.method"))
   anova_table[,"Pr(>F)"] <- p.adjust(anova_table[,"Pr(>F)"], method = p.adjust.method)
+  class(anova_table) <- c("anova", "data.frame")
+  p_adj_heading <- if(p.adjust.method != "none") paste0(", ", p.adjust.method, "-adjusted") else NULL
+  attr(anova_table, "heading") <- c(paste0("Anova Table (Type ", attr(object, "type"), " tests", p_adj_heading, ")\n"), paste("Response:", attr(object, "dv")))
   attr(anova_table, "p.adjust.method") <- p.adjust.method
+  attr(anova_table, "correction") <- if(length(attr(object, "within")) > 0) correction else "none"
+  attr(anova_table, "observed") <- if(!is.null(observed) & length(observed) > 0) observed else character(0)
   anova_table
 }
 
@@ -118,10 +123,12 @@ print.afex_aov <- function(x, ...) {
 #' @method summary afex_aov 
 #' @export
 summary.afex_aov <- function(object, ...) {
-  if (class(object$Anova)[1] == "Anova.mlm") {
+  if (inherits(object$Anova, "Anova.mlm")) {
+  #if (class(object$Anova)[1] == "Anova.mlm") {
     if(attr(object$anova_table, "p.adjust.method") != "none") message("Note, results are NOT adjusted for multiple comparisons as requested\n(p.adjust.method = '", attr(object$anova_table, "p.adjust.method"), "')\nbecause the desired method of sphericity correction is unknown.\nFor adjusted p-values print the object (to see object$anova_table), or call\none of anova.afex_aov() or nice().")
     return(summary(object$Anova, multivariate = FALSE))
-  } else if (class(object$Anova)[1] == "anova") {
+  #} else if (class(object$Anova)[1] == "anova") {
+  } else if (inherits(object$Anova, "anova")) {
     return(object$anova_table)
   } else stop("Non-supported object passed. Slot 'Anova' needs to be of class 'Anova.mlm' or 'anova'.")
 }
diff --git a/R/mixed.R b/R/mixed.R
index 0bdee12..0b1c6bb 100644
--- a/R/mixed.R
+++ b/R/mixed.R
@@ -15,7 +15,7 @@
 #' @param set.data.arg \code{logical}. Should the data argument in the slot \code{call} of the \code{merMod} object returned from \code{lmer} be set to the passed data argument? Otherwise the name will be \code{data}. Helpful if fitted objects are used afterwards (e.g., using \pkg{lsmeans}). Default is \code{TRUE}. 
 #' @param progress  if \code{TRUE}, shows progress with a text progress bar and other status messages during fitting.
 #' @param cl  A vector identifying a cluster; used for distributing the estimation of the different models using several cores. See examples. If \code{ckeck.contrasts}, mixed sets the current contrasts (\code{getOption("contrasts")}) at the nodes. Note this does \emph{not} distribute calculation of p-values (e.g., when using \code{method = "PB"}) across the cluster. Use \code{args.test} for this.
-#' @param return the default is to return an object of class \code{"mixed"}. \code{return = "merMod"} will skip the calculation of all submodels and p-values and simply return the full model fitted with lmer. Can be useful in combination with \code{expand_re = TRUE} which allows to use "||" with factors.
+#' @param return the default is to return an object of class \code{"mixed"}. \code{return = "merMod"} will skip the calculation of all submodels and p-values and simply return the full model fitted with lmer. Can be useful in combination with \code{expand_re = TRUE} which allows to use "||" with factors. \code{return = "data"} will not fit any models but just return the data that would have been used for fitting the model. Can be used in combination with \code{expand_re = TRUE} and \code [...]
 #' @param ... further arguments (such as \code{weights}/\code{family}) passed to \code{\link{lmer}}/\code{\link{glmer}}.
 #'
 #'
@@ -166,7 +166,8 @@ mixed <- function(formula, data, type = afex_options("type"), method = afex_opti
   mc <- match.call()
   #browser()
   formula.f <- as.formula(formula)
-  if (class(formula) != "formula") message("Formula (the first argument) converted to formula.")
+  #if (class(formula) != "formula") message("Formula (the first argument) converted to formula.")
+  if (!inherits(formula, "formula")) message("Formula (the first argument) converted to formula.")
   dv <- as.character(formula.f)[[2]]
   all.terms <- attr(terms(formula.f), "term.labels")
   effect.order <- attr(terms(formula.f), "order")
@@ -221,6 +222,7 @@ mixed <- function(formula, data, type = afex_options("type"), method = afex_opti
     data <- cbind(data, as.data.frame(do.call(cbind, tmp_model.matrix)))
     random <- str_c(new_random, collapse = "+")
   }
+  if (return == "data") return(data)
   ####################
   ### Part II: obtain the lmer fits
   ####################
@@ -327,7 +329,6 @@ mixed <- function(formula, data, type = afex_options("type"), method = afex_opti
     fits <- clusterApplyLB(cl = cl, x = formulas, eval.cl, m.call = mf, progress = progress)
     if (progress) junk <- clusterEvalQ(cl = cl, cat("]"))
   }
-  ## add correct data argument to lmer calls:
 
   ####################
   ### Part IIb: likelihood checks and refitting
@@ -359,7 +360,7 @@ mixed <- function(formula, data, type = afex_options("type"), method = afex_opti
       browser()
       str(fits[[1]], 2)
       fits[[1]]@call
-      sapply(allFit(fits[[1]], data=md_16.4b), function(y) try(logLik(y)))
+      #sapply(allFit(fits[[1]], data=md_16.4b), function(y) try(logLik(y)))
       sapply(refits, function(x) sapply(x, function(y) tryCatch(as.numeric(logLik(y)), error = function(e) as.numeric(NA))))
       
       fits <- lapply(refits, function(x) {
@@ -521,10 +522,15 @@ get_mixed_warnings <- function(x) {
   }
   warnings <- mapply(function(x, y) c(unlist(x), y), warnings1, warnings2, SIMPLIFY=FALSE)  
   warn <- vapply(warnings, function(y) !length(y)==0, NA)
-  for (i in names(warn)[warn]) warning("lme4 reported (at least) the following warnings for '", i, "':\n  * ", paste(warnings[[i]], collapse = "\n  * "))
+  for (i in names(warn)[warn]) warning("lme4 reported (at least) the following warnings for '", i, "':\n  * ", paste(warnings[[i]], collapse = "\n  * "), call. = FALSE)
 }
 
 check_likelihood <- function(object) {
+  
+   if (is.null(attr(object, "type"))) {
+    attr(object, "type") <- object$type
+  }
+  
   if (attr(object, "type") == 3 | attr(object, "type") == "III") {
     logLik_full <- as.numeric(logLik(object[["full.model"]]))
     logLik_restricted <- as.numeric(vapply(object[["restricted.models"]], logLik, 0))
@@ -562,7 +568,7 @@ lmer_alt <- function(formula, data, check.contrasts = FALSE, ...) {
 #' @export
 print.mixed <- function(x, ...) {
   if(!isREML(x[["full.model"]]) && !isTRUE(check_likelihood(x))) 
-    warning(paste("Following nested model(s) provide better fit than full model:", paste(check_likelihood(x), collapse = ", "), "\n  It is highly recommended to try different optimizer via lmerControl or allFit!"))
+    warning(paste("Following nested model(s) provide better fit than full model:", paste(check_likelihood(x), collapse = ", "), "\n  It is highly recommended to try different optimizer via lmerControl or allFit!"), call. = FALSE)
   get_mixed_warnings(x)
   tmp <- nice.mixed(x, ...)
   print(tmp)
@@ -591,7 +597,7 @@ anova.mixed <- function(object, ..., refit = FALSE) {
     return(do.call(anova, args = c(object = object, dots, model.names = list(model.names), refit = refit)))
   } else {
     if(!isREML(object[["full.model"]]) && !isTRUE(check_likelihood(object))) 
-      warning(paste("Following nested model(s) provide better fit than full model:", paste(check_likelihood(object), collapse = ", "), "\n  It is highly recommended to try different optimizer via lmerControl or allFit!"))
+      warning(paste("Following nested model(s) provide better fit than full model:", paste(check_likelihood(object), collapse = ", "), "\n  It is highly recommended to try different optimizer via lmerControl or allFit!"), call. = FALSE)
     get_mixed_warnings(object)
     object$anova_table
   }
diff --git a/R/nice.R b/R/nice.R
index eeb2e1c..3ddafa5 100644
--- a/R/nice.R
+++ b/R/nice.R
@@ -3,7 +3,7 @@
 #' This generic function produces a nice ANOVA table for printin for objects of class. \code{nice_anova} takes an object from \code{\link[car]{Anova}} possible created by the convenience functions \code{\link{aov_ez}} or \code{\link{aov_car}}. When within-subject factors are present, either sphericity corrected or uncorrected degrees of freedom can be reported.
 #' 
 #'
-#' @param object An object of class \code{"Anova.mlm"} or \code{"anova"} as returned from \code{\link[car]{Anova}} or the \pkg{afex} ANOVA functions (see \code{\link{aov_car}}).
+#' @param object,x An object of class \code{"afex_aov"} (see \code{\link{aov_car}}) or of class \code{"mixed"} (see \code{\link{mixed}}) as returned from the \pkg{afex} functions. Alternatively, an object of class \code{"Anova.mlm"} or \code{"anova"} as returned from \code{\link[car]{Anova}}.
 #' @param es Effect Size to be reported. The default is given by \code{afex_options("es_aov")}, which is initially set to \code{"ges"} (i.e., reporting generalized eta-squared, see details). Also supported is partial eta-squared (\code{"pes"}) or \code{"none"}.
 #' @param 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 \code{es} is not \code{"ges"}), see details.
 #' @param correction Character. Which sphericity correction of the degrees of freedom should be reported for the within-subject factors.  The default is given by \code{afex_options("correction_aov")}, which is initially set to \code{"GG"} corresponding to the Greenhouse-Geisser correction. Possible values are \code{"GG"}, \code{"HF"} (i.e., Hyunh-Feldt correction), and \code{"none"} (i.e., no correction).
@@ -13,7 +13,7 @@
 #' @param intercept logical. Should intercept (if present) be included in the ANOVA table? Default is \code{FALSE} which hides the intercept.
 #' @param ... currently ignored.
 #'
-#' @return A \code{data.frame} with the ANOVA table consisting of characters. The columns that are always present are: \code{Effect}, \code{df} (degrees of freedom), \code{F}, and \code{p}.
+#' @return A \code{data.frame} of class \code{nice_table} with the ANOVA table consisting of characters. The columns that are always present are: \code{Effect}, \code{df} (degrees of freedom), \code{F}, and \code{p}.
 #'
 #' \code{ges} contains the generalized eta-squared effect size measure (Bakeman, 2005), \code{pes} contains partial eta-squared (if requested).
 #'
@@ -38,8 +38,6 @@
 #' 
 #' @name nice
 #' @importFrom stats anova
-#' @export nice
-#' 
 #' @encoding UTF-8
 #'
 #' @examples
@@ -74,15 +72,24 @@
 #' print.xtable(xtable(full, caption = "ANOVA 2"), include.rownames = FALSE)
 #' }
 #' 
-#' 
+#' @export nice
 nice <- function(object, ...) UseMethod("nice", object)
 
 
 #' @rdname nice
 #' @method nice afex_aov
 #' @export
-nice.afex_aov <- function(object, es = afex_options("es_aov"), observed = NULL, correction = afex_options("correction_aov"), MSE = TRUE, intercept = FALSE, sig.symbols = c(" +", " *", " **", " ***"), p.adjust.method = NULL, ...) { 
-  if(is.null(p.adjust.method)) p.adjust.method <- ifelse(is.null(attr(object$anova_table, "p.adjust.method")), "none", attr(object$anova_table, "p.adjust.method"))
+nice.afex_aov <- function(object, es = NULL, observed = attr(object$anova_table, "observed"), correction = attr(object$anova_table, "correction"), MSE = NULL, intercept = NULL, p.adjust.method = attr(object$anova_table, "p.adjust.method"), sig.symbols = c(" +", " *", " **", " ***"), ...) { 
+  if(is.null(es)) { # Defaults to afex_options("es") because of default set in anova.afex_aov
+    es <- c("pes", "ges")[c("pes", "ges") %in% colnames(object$anova_table)]
+  }
+  if(is.null(MSE)) { # Defaults to TRUE because of default set in anova.afex_aov
+    MSE <- "MSE" %in% colnames(object$anova_table)
+  }
+  if(is.null(intercept)) { # Defaults to FALSE because of default set in anova.afex_aov
+    intercept <- "(Intercept)" %in% rownames(object$anova_table)
+  }
+  
   anova_table <- as.data.frame(anova(object, es = es, observed = observed, correction = correction, MSE = MSE, intercept = intercept, p.adjust.method = p.adjust.method))
   nice.anova(anova_table, MSE = MSE, intercept = intercept, sig.symbols = sig.symbols)
 }
@@ -111,6 +118,11 @@ nice.anova <- function(object, MSE = TRUE, intercept = FALSE, sig.symbols = c("
   df.out$p.value  <-  round_ps(anova_table[,"Pr(>F)"])
   if (!intercept) if (df.out[1,1] == "(Intercept)")  df.out <- df.out[-1,, drop = FALSE]
   rownames(df.out) <- NULL
+  attr(df.out, "heading") <- attr(object, "heading")
+  attr(df.out, "p.adjust.method") <- attr(object, "p.adjust.method")
+  attr(df.out, "correction") <- attr(object, "correction")
+  attr(df.out, "observed") <- attr(object, "observed")
+  class(df.out) <- c("nice_table", class(df.out))
   df.out
 }
 
@@ -130,7 +142,11 @@ nice.mixed <- function(object, sig.symbols = c(" +", " *", " **", " ***"), ...)
   anova_table <- object$anova_table
   symbols.use <-  c(" +", " *", " **", " ***")
   symbols.use[seq_along(sig.symbols)] <- sig.symbols
-  if (attr(object, "method") == "KR") {
+  
+  if (is.null(attr(object, "method"))) {
+    df.out <- object[[1]]
+    warning("mixed object was created with old version of afex, table not nicely formatted.")
+  } else if (attr(object, "method") == "KR") {
     anova_table[,"df"] <- paste(ifelse(is.wholenumber(anova_table[,"num Df"]), round(anova_table[,"num Df"]), formatC(anova_table[,"num Df"], digits = 2, format = "f")),  ifelse(is.wholenumber(anova_table[,"den Df"]), round(anova_table[,"den Df"]), formatC(anova_table[,"den Df"], digits = 2, format = "f")), sep = ", ")
     df.out <- data.frame(Effect = row.names(anova_table), df = anova_table[,"df"], "F.scaling" = formatC(anova_table[,"F.scaling"], digits = 2, format = "f"), stringsAsFactors = FALSE, check.names = FALSE)
     df.out <- cbind(df.out, data.frame(F = make.stat(anova_table, stat = "F", symbols.use), stringsAsFactors = FALSE))
@@ -142,5 +158,21 @@ nice.mixed <- function(object, sig.symbols = c(" +", " *", " **", " ***"), ...)
     df.out <- data.frame(Effect = row.names(anova_table), df = anova_table[,"Chi Df"], Chisq = make.stat(anova_table, stat = "Chisq", symbols.use), p.value = round_ps(anova_table[,"Pr(>Chisq)"]), stringsAsFactors = FALSE, check.names = FALSE)
   } else stop("method of mixed object not supported.")
   rownames(df.out) <- NULL
-  return(df.out)
+  class(df.out) <- c("nice_table", class(df.out))
+  df.out
+}
+
+
+#' @rdname nice
+#' @method print nice_table
+#' @export
+print.nice_table <- function(x, ...) {
+  if(!is.null(heading <- attr(x, "heading"))) {
+    cat(heading, sep = "\n")
+  }
+  print.data.frame(x)
+  if(!is.null(correction_method <- attr(x, "correction")) && correction_method != "none") {
+    cat("\nSphericity correction method:", correction_method, "\n")
+  }
+  invisible(x)
 }
diff --git a/R/set_contrasts.R b/R/set_contrasts.R
index 71ca845..da0830f 100644
--- a/R/set_contrasts.R
+++ b/R/set_contrasts.R
@@ -20,7 +20,6 @@
 #' @name set_sum_contrasts
 #' @aliases set_sum_contrasts set_deviation_contrasts set_effects_contrasts set_treatment_contrasts set_default_contrasts
 #' @export set_sum_contrasts set_deviation_contrasts set_effects_contrasts set_treatment_contrasts set_default_contrasts
-#' 
 
 set_sum_contrasts <- function() {
   message("setting contr.sum globally: options(contrasts=c('contr.sum', 'contr.poly'))")
diff --git a/build/vignette.rds b/build/vignette.rds
index ef8a654..f79993c 100644
Binary files a/build/vignette.rds and b/build/vignette.rds differ
diff --git a/inst/doc/anova_posthoc.html b/inst/doc/anova_posthoc.html
index ddb6dad..1535f40 100644
--- a/inst/doc/anova_posthoc.html
+++ b/inst/doc/anova_posthoc.html
@@ -10,7 +10,7 @@
 
 <meta name="author" content="Henrik Singmann" />
 
-<meta name="date" content="2015-10-24" />
+<meta name="date" content="2016-04-02" />
 
 <title>ANOVA and Post-Hoc Contrasts: Reanalysis of Singmann and Klauer (2011)</title>
 
@@ -54,7 +54,7 @@ code > span.er { color: #ff0000; font-weight: bold; }
 <div id="header">
 <h1 class="title">ANOVA and Post-Hoc Contrasts: Reanalysis of Singmann and Klauer (2011)</h1>
 <h4 class="author"><em>Henrik Singmann</em></h4>
-<h4 class="date"><em>2015-10-24</em></h4>
+<h4 class="date"><em>2016-04-02</em></h4>
 </div>
 
 
@@ -129,19 +129,23 @@ code > span.er { color: #ff0000; font-weight: bold; }
 <p>To get the full ANOVA table for the model, we simply pass it to <code>aov_ez</code> (<code>aov_car</code> or <code>aov4</code> would be alternatives producing the same results) using the design as described above. We save the returned object for further analysis.</p>
 <pre class="sourceCode r"><code class="sourceCode r">a1 <-<span class="st"> </span><span class="kw">aov_ez</span>(<span class="st">"id"</span>, <span class="st">"response"</span>, sk2011<span class="fl">.1</span>, <span class="dt">between =</span> <span class="st">"instruction"</span>, 
        <span class="dt">within =</span> <span class="kw">c</span>(<span class="st">"inference"</span>, <span class="st">"plausibility"</span>))</code></pre>
-<pre><code>## Warning in aov_car(formula = as.formula(formula), data = data, fun.aggregate =
-## fun.aggregate, : More than one observation per cell, aggregating the data using mean (i.e,
+<pre><code>## Warning: More than one observation per cell, aggregating the data using mean (i.e,
 ## fun.aggregate = mean)!</code></pre>
 <pre><code>## Contrasts set to contr.sum for the following variables: instruction</code></pre>
 <pre class="sourceCode r"><code class="sourceCode r">a1 <span class="co"># the default print method prints a data.frame produced by nice </span></code></pre>
-<pre><code>##                               Effect           df     MSE         F  ges p.value
+<pre><code>## Anova Table (Type 3 tests)
+## 
+## Response: response
+##                               Effect           df     MSE         F  ges p.value
 ## 1                        instruction        1, 38 2027.42      0.31 .003     .58
 ## 2                          inference 2.66, 101.12  959.12   5.81 **  .06    .002
 ## 3              instruction:inference 2.66, 101.12  959.12   6.00 **  .07    .001
 ## 4                       plausibility        1, 38  468.82 34.23 ***  .07  <.0001
 ## 5           instruction:plausibility        1, 38  468.82  10.67 **  .02    .002
 ## 6             inference:plausibility  2.29, 87.11  318.91    2.87 + .009     .06
-## 7 instruction:inference:plausibility  2.29, 87.11  318.91    3.98 *  .01     .02</code></pre>
+## 7 instruction:inference:plausibility  2.29, 87.11  318.91    3.98 *  .01     .02
+## 
+## Sphericity correction method: GG</code></pre>
 <p>As mentioned before, the two responses per cell of the design and participants are aggregated for the analysis as indicated by the warning message. Furthermore, the degrees of freedom are Greenhouse-Geisser corrected per default for all effects involving <code>inference</code>, as <code>inference</code> is a within-subject factor with more than two levels (i.e., MP, MT, AC, & DA). In line with our expectations, the three-way interaction is significant.</p>
 <p>The object printed per default for <code>afex_aov</code> objects (produced by <code>nice</code>) can also be printed nicely using <code>knitr</code>:</p>
 <pre class="sourceCode r"><code class="sourceCode r">knitr::<span class="kw">kable</span>(<span class="kw">nice</span>(a1))</code></pre>
@@ -217,8 +221,8 @@ code > span.er { color: #ff0000; font-weight: bold; }
 </table>
 <p>Alternatively, the <code>anova</code> method for <code>afex_aov</code> objects returns a <code>data.frame</code> of class <code>anova</code> that can be passed to, for example, <code>xtable</code> for nice formatting:</p>
 <pre class="sourceCode r"><code class="sourceCode r"><span class="kw">print</span>(xtable::<span class="kw">xtable</span>(<span class="kw">anova</span>(a1), <span class="dt">digits =</span> <span class="kw">c</span>(<span class="kw">rep</span>(<span class="dv">2</span>, <span class="dv">5</span>), <span class="dv">3</span>, <span class="dv">4</span>)), <span class="dt">type =</span> <span class="st">"html"</span>)</code></pre>
-<!-- html table generated in R 3.2.2 by xtable 1.7-4 package -->
-<!-- Sat Oct 24 23:27:23 2015 -->
+<!-- html table generated in R 3.2.4 by xtable 1.8-0 package -->
+<!-- Sat Apr  2 18:46:30 2016 -->
 <table border="1">
 <tr>
 <th>
@@ -438,17 +442,18 @@ instruction:inference:plausibility
 ## P value adjustment: tukey method for comparing a family of 4 estimates</code></pre>
 <p>To obtain more powerful p-value adjustments, we can furthermore pass it to <code>multcomp</code> (Bretz, Hothorn, & Westfall, 2011):</p>
 <pre class="sourceCode r"><code class="sourceCode r"><span class="kw">summary</span>(<span class="kw">as.glht</span>(<span class="kw">pairs</span>(m1)), <span class="dt">test=</span><span class="kw">adjusted</span>(<span class="st">"free"</span>))</code></pre>
+<pre><code>## Note: df set to 114</code></pre>
 <pre><code>## 
 ##   Simultaneous Tests for General Linear Hypotheses
 ## 
 ## Linear Hypotheses:
 ##              Estimate Std. Error t value Pr(>|t|)    
-## MP - MT == 0   10.831      4.612   2.349 0.068998 .  
-## MP - AC == 0   18.100      4.612   3.925 0.000797 ***
+## MP - MT == 0   10.831      4.612   2.349 0.068846 .  
+## MP - AC == 0   18.100      4.612   3.925 0.000845 ***
 ## MP - DA == 0    4.556      4.612   0.988 0.325273    
-## MT - AC == 0    7.269      4.612   1.576 0.281795    
+## MT - AC == 0    7.269      4.612   1.576 0.281712    
 ## MT - DA == 0   -6.275      4.612  -1.361 0.296932    
-## AC - DA == 0  -13.544      4.612  -2.937 0.017434 *  
+## AC - DA == 0  -13.544      4.612  -2.937 0.017714 *  
 ## ---
 ## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 ## (Adjusted p values reported -- free method)</code></pre>
@@ -563,6 +568,7 @@ instruction:inference:plausibility
 ## Results are averaged over the levels of: plausibility 
 ## P value adjustment: holm method for 2 tests</code></pre>
 <pre class="sourceCode r"><code class="sourceCode r"><span class="kw">summary</span>(<span class="kw">as.glht</span>(<span class="kw">contrast</span>(m3, c1)), <span class="dt">test =</span><span class="kw">adjusted</span>(<span class="st">"free"</span>))</code></pre>
+<pre><code>## Note: df set to 114</code></pre>
 <pre><code>## 
 ##   Simultaneous Tests for General Linear Hypotheses
 ## 
@@ -588,12 +594,14 @@ instruction:inference:plausibility
 <p>As this plot is not very helpful, we now fit a new ANOVA model in which we separate the data in affirmation and denial inferences, as done in the original manuscript and plot the data then a second time.</p>
 <pre class="sourceCode r"><code class="sourceCode r">a2 <-<span class="st"> </span><span class="kw">aov_ez</span>(<span class="st">"id"</span>, <span class="st">"response"</span>, sk2011<span class="fl">.1</span>, <span class="dt">between =</span> <span class="st">"instruction"</span>, 
        <span class="dt">within =</span> <span class="kw">c</span>(<span class="st">"validity"</span>, <span class="st">"plausibility"</span>, <span class="st">"what"</span>))</code></pre>
-<pre><code>## Warning in aov_car(formula = as.formula(formula), data = data, fun.aggregate =
-## fun.aggregate, : More than one observation per cell, aggregating the data using mean (i.e,
+<pre><code>## Warning: More than one observation per cell, aggregating the data using mean (i.e,
 ## fun.aggregate = mean)!</code></pre>
 <pre><code>## Contrasts set to contr.sum for the following variables: instruction</code></pre>
 <pre class="sourceCode r"><code class="sourceCode r">a2</code></pre>
-<pre><code>##                                    Effect    df     MSE         F    ges p.value
+<pre><code>## Anova Table (Type 3 tests)
+## 
+## Response: response
+##                                    Effect    df     MSE         F    ges p.value
 ## 1                             instruction 1, 38 2027.42      0.31   .003     .58
 ## 2                                validity 1, 38  678.65    4.12 *    .01     .05
 ## 3                    instruction:validity 1, 38  678.65    4.65 *    .01     .04
@@ -608,7 +616,9 @@ instruction:inference:plausibility
 ## 12                      plausibility:what 1, 38  204.54   9.97 **   .009    .003
 ## 13          instruction:plausibility:what 1, 38  204.54    5.23 *   .005     .03
 ## 14             validity:plausibility:what 1, 38  154.62      0.03 <.0001     .85
-## 15 instruction:validity:plausibility:what 1, 38  154.62      0.42  .0003     .52</code></pre>
+## 15 instruction:validity:plausibility:what 1, 38  154.62      0.42  .0003     .52
+## 
+## Sphericity correction method: GG</code></pre>
 <p>Then we plot the data from this ANOVA.</p>
 <pre class="sourceCode r"><code class="sourceCode r"><span class="kw">lsmip</span>(a2, ~instruction ~<span class="st"> </span>plausibility+validity|what, 
       <span class="dt">scales =</span> <span class="kw">list</span>(<span class="dt">x=</span><span class="kw">list</span>(
@@ -677,6 +687,7 @@ instruction:inference:plausibility
 ## P value adjustment: holm method for 8 tests</code></pre>
 <p>As the resulting eight contrasts have different numbers of degrees-of-freedom, we can only pass them to <code>multcomp</code> in small batches. This gives us more powerful Type 1 error corrections but overall a reduced correction as we now control for three families of tests (i.e., overall Type 1 error probability of .15).</p>
 <pre class="sourceCode r"><code class="sourceCode r"><span class="kw">summary</span>(<span class="kw">as.glht</span>(<span class="kw">contrast</span>(m4, c2[<span class="dv">1</span>:<span class="dv">4</span>])), <span class="dt">test =</span><span class="kw">adjusted</span>(<span class="st">"free"</span>))</code></pre>
+<pre><code>## Note: df set to 184</code></pre>
 <pre><code>## $`what = affirmation`
 ## 
 ##   Simultaneous Tests for General Linear Hypotheses
@@ -684,8 +695,8 @@ instruction:inference:plausibility
 ## Linear Hypotheses:
 ##             Estimate Std. Error t value Pr(>|t|)    
 ## diff_1 == 0    4.175      8.500   0.491 0.623874    
-## diff_2 == 0   34.925      8.500   4.109 0.000234 ***
-## diff_3 == 0  -23.600      8.500  -2.777 0.017357 *  
+## diff_2 == 0   34.925      8.500   4.109 0.000235 ***
+## diff_3 == 0  -23.600      8.500  -2.777 0.017295 *  
 ## diff_4 == 0   -8.100      8.500  -0.953 0.564739    
 ## ---
 ## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
@@ -706,6 +717,7 @@ instruction:inference:plausibility
 ## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 ## (Adjusted p values reported -- free method)</code></pre>
 <pre class="sourceCode r"><code class="sourceCode r"><span class="kw">summary</span>(<span class="kw">as.glht</span>(<span class="kw">contrast</span>(m4, c2[<span class="dv">5</span>:<span class="dv">6</span>])), <span class="dt">test =</span><span class="kw">adjusted</span>(<span class="st">"free"</span>))</code></pre>
+<pre><code>## Note: df set to 70</code></pre>
 <pre><code>## $`what = affirmation`
 ## 
 ##   Simultaneous Tests for General Linear Hypotheses
@@ -729,6 +741,7 @@ instruction:inference:plausibility
 ## val_prob == 0   -1.137      6.877  -0.165    0.869
 ## (Adjusted p values reported -- free method)</code></pre>
 <pre class="sourceCode r"><code class="sourceCode r"><span class="kw">summary</span>(<span class="kw">as.glht</span>(<span class="kw">contrast</span>(m4, c2[<span class="dv">7</span>:<span class="dv">8</span>])), <span class="dt">test =</span><span class="kw">adjusted</span>(<span class="st">"free"</span>))</code></pre>
+<pre><code>## Note: df set to 65</code></pre>
 <pre><code>## $`what = affirmation`
 ## 
 ##   Simultaneous Tests for General Linear Hypotheses
diff --git a/man/afex-package.Rd b/man/afex-package.Rd
index 1e51efe..421e5df 100644
--- a/man/afex-package.Rd
+++ b/man/afex-package.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/afex-package.R
 \docType{package}
 \name{afex-package}
@@ -11,9 +11,9 @@ Analysis of Factorial Experiments.
 \tabular{ll}{
 Package: \tab afex\cr
 Type: \tab Package\cr
-Version: \tab 0.15-2\cr
-Date: \tab 2015-10-24\cr
-Depends: \tab R (>= 3.0.0), lme4 (>= 1.0.5), reshape2, lsmeans (>= 2.17)\cr
+Version: \tab 0.16-1\cr
+Date: \tab 2016-04-04\cr
+Depends: \tab R (>= 3.1.0), lme4 (>= 1.1-8), reshape2, lsmeans (>= 2.17)\cr
 Encoding: \tab UTF-8\cr
 License: \tab GPL (>=3)\cr
 URL: \tab https://github.com/singmann/afex\cr
@@ -22,7 +22,7 @@ URL: \tab https://github.com/singmann/afex\cr
 Provides convenience functions for analyzing factorial experiments using ANOVA or mixed models. aov_ez(), aov_car(), and aov_4() allow specification of between, within (i.e., repeated-measures), or mixed between-within (i.e., split-plot) ANOVAs for data in long format (i.e., one observation per row), potentially aggregating multiple observations per individual and cell of the design. mixed() fits mixed models using lme4::lmer() and computes p-values for all fixed effects using either Ken [...]
 }
 \author{
-Henrik Singmann, Ben Bolker, Jake Westfall, with contributions from Søren Højsgaard, John Fox, Michael A. Lawrence, Ulf Mertens, Frederik Aust
+Henrik Singmann, Ben Bolker, Jake Westfall, Frederik Aust, with contributions from Søren Højsgaard, John Fox, Michael A. Lawrence, Ulf Mertens
 }
 \keyword{package}
 
diff --git a/man/afex_aov-methods.Rd b/man/afex_aov-methods.Rd
index de0c77f..cae8184 100644
--- a/man/afex_aov-methods.Rd
+++ b/man/afex_aov-methods.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/methods.afex_aov.R
 \name{afex_aov-methods}
 \alias{afex_aov-methods}
@@ -22,7 +22,7 @@
 \method{lsm.basis}{afex_aov}(object, trms, xlev, grid, ...)
 }
 \arguments{
-\item{object,x}{object of class \code{afex_aov} as returned from \code{\link{aov_car}} and related functions.}
+\item{object, x}{object of class \code{afex_aov} as returned from \code{\link{aov_car}} and related functions.}
 
 \item{es}{Effect Size to be reported. The default is given by \code{afex_options("es_aov")}, which is initially set to \code{"ges"} (i.e., reporting generalized eta-squared, see details). Also supported is partial eta-squared (\code{"pes"}) or \code{"none"}.}
 
@@ -38,7 +38,7 @@
 
 \item{...}{further arguments passed through, see description of return value for details.}
 
-\item{trms,xlev,grid}{same as for \code{\link{lsm.basis}}.}
+\item{trms, xlev, grid}{same as for \code{\link{lsm.basis}}.}
 }
 \value{
 \describe{
@@ -46,7 +46,7 @@
   \item{\code{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 \code{summary.Anova.mlm}). For other ANOVAs, the \code{anova} table is simply returned.}
   \item{\code{print}}{Prints (and invisibly returns) the ANOVA table as constructed from \code{\link{nice}} (i.e., as strings rounded nicely). Arguments in \code{...} are passed to \code{nice} allowing to pass arguments such as \code{es} and \code{correction}.}
   \item{\code{recover.data} and \code{lsm.basis}}{Provide the backbone for using \code{\link{lsmeans}} and related functions from \pkg{lsmeans} directly on \code{afex_aov} objects by returning a \code{\link{ref.grid}} object. Should not be called directly but through the functionality provided by \pkg{lsmeans}.}
-
+  
 }
 }
 \description{
diff --git a/man/afex_options.Rd b/man/afex_options.Rd
index 17baea8..1e1ddde 100644
--- a/man/afex_options.Rd
+++ b/man/afex_options.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/helpers.R
 \name{afex_options}
 \alias{afex_options}
@@ -21,7 +21,7 @@ The following arguments are currently set:
 \item \code{check.contrasts} should contrasts be checked and changed to sum-to-zero contrasts? Default is \code{TRUE}.
 \item \code{type} type of sums-of-squares to be used for testing effects, default is 3 which reports Type 3 tests.
 \item \code{method_mixed}: Method used to obtain p-values in \code{\link{mixed}}, default is \code{"KR"} (which will change to \code{"LRT"} soon). (\code{mixed()} only)
-\item \code{return_aov}: Return value of the ANOVA functions (see \code{\link{aov_car}}), default is \code{"nice"}.
+\item \code{return_aov}: Return value of the ANOVA functions (see \code{\link{aov_car}}), default is \code{"nice"}. 
 \item \code{es_aov}: Effect size reported for ANOVAs (see \code{\link{aov_car}}), default is \code{"ges"} (generalized eta-squared).
 \item \code{correction_aov}: Correction used for within-subjects factors with more than two levels for ANOVAs  (see \code{\link{aov_car}} or \code{\link{nice}}), default is \code{"GG"} (Greenhouse-Geisser correction). (ANOVA functions only)
 \item \code{factorize}: Should between subject factors be factorized (with note) before running the analysis? Default is \code{TRUE}. (ANOVA functions only)
@@ -37,5 +37,6 @@ afex_options("return_aov", "check.contrasts")  # returns only first value!
 \dontrun{
 afex_options(return_aov = "nice")
 }
+
 }
 
diff --git a/man/allFit.Rd b/man/allFit.Rd
index d50998f..6a0e9c6 100644
--- a/man/allFit.Rd
+++ b/man/allFit.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/allFit.R
 \name{allFit}
 \alias{allFit}
@@ -41,15 +41,35 @@ here are really base R functions that can be accessed via optimx,
 Needs packages \pkg{nloptr} and \pkg{optimx} to try out all optimizers. \pkg{optimx} needs to be loaded explicitly using \code{library} or \code{require}.
 }
 \examples{
+
 \dontrun{
+
+# basic usage
 require(optimx)
 gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
-data = cbpp, family = binomial)
+             data = cbpp, family = binomial)
 gm_all <- allFit(gm1)
 t(sapply(gm_all,fixef)) ## extract fixed effects
 sapply(gm_all,logLik) ## log-likelihoods
 sapply(gm_all,getME,"theta") ## theta parameters
 !sapply(gm_all,inherits,"try-error") ## was fit OK?
+
+
+## use allFit in combination with expand.re = TRUE
+data("sk2011.2") # see example("mixed")
+sk2_aff <- droplevels(sk2011.2[sk2011.2$what == "affirmation",])
+sk_m2 <- mixed(response ~ instruction*inference*type+(inference*type||id), sk2_aff,
+               expand_re = TRUE)
+sk_m2
+sk_m2_allFit <- allFit(sk_m2$full.model)
+sk_m2_allFit # all fits fail
+
+sk2_aff_b <- mixed(response ~ instruction*inference*type+(inference*type||id), sk2_aff,
+               expand_re = TRUE, return = "data") # returns data only
+sk_m2_allFit <- allFit(sk_m2$full.model, data = sk2_aff_b) # works now
+t(sapply(sk_m2_allFit,fixef))
+sapply(sk_m2_allFit,logLik)
+
 }
 }
 \author{
diff --git a/man/aov_car.Rd b/man/aov_car.Rd
index 14d88c8..3dff7b8 100644
--- a/man/aov_car.Rd
+++ b/man/aov_car.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/aov_car.R
 \encoding{UTF-8}
 \name{aov_car}
@@ -7,23 +7,23 @@
 \alias{aov_ez}
 \title{Convenient ANOVA estimation for factorial designs}
 \usage{
-aov_ez(id, dv, data, between = NULL, within = NULL, covariate = NULL,
-     observed = NULL, fun.aggregate = NULL, type = afex_options("type"),
-     factorize = afex_options("factorize"),
-     check.contrasts = afex_options("check.contrasts"),
-     return = afex_options("return_aov"),
+aov_ez(id, dv, data, between = NULL, within = NULL, covariate = NULL, 
+     observed = NULL, fun.aggregate = NULL, type = afex_options("type"), 
+     factorize = afex_options("factorize"), 
+     check.contrasts = afex_options("check.contrasts"), 
+     return = afex_options("return_aov"), 
      anova_table = list(), ..., print.formula = FALSE)
-
-aov_car(formula, data, fun.aggregate = NULL, type = afex_options("type"),
-     factorize = afex_options("factorize"),
-     check.contrasts = afex_options("check.contrasts"),
-     return = afex_options("return_aov"), observed = NULL,
+     
+aov_car(formula, data, fun.aggregate = NULL, type = afex_options("type"), 
+     factorize = afex_options("factorize"), 
+     check.contrasts = afex_options("check.contrasts"), 
+     return = afex_options("return_aov"), observed = NULL, 
      anova_table = list(), ...)
-
+     
 aov_4(formula, data, observed = NULL, fun.aggregate = NULL, type = afex_options("type"),
-     factorize = afex_options("factorize"),
+     factorize = afex_options("factorize"), 
      check.contrasts = afex_options("check.contrasts"),
-     return = afex_options("return_aov"),
+     return = afex_options("return_aov"), 
      anova_table = list(), ..., print.formula = FALSE)
 }
 \arguments{
@@ -60,7 +60,7 @@ aov_4(formula, data, observed = NULL, fun.aggregate = NULL, type = afex_options(
 \item{print.formula}{\code{aov_ez} and \code{aov_4} are wrapper for \code{aov_car}. This boolean argument indicates whether the formula in the call to \code{car.aov} should be printed.}
 }
 \value{
-\code{aov_car}, \code{aov_4}, and \code{aov_ez} are wrappers for \code{\link[car]{Anova}} and \code{\link{aov}}, the return value is dependent on the \code{return} argument. Per default, an S3 object of class \code{"afex_aov"} is returned containing the following slots:
+\code{aov_car}, \code{aov_4}, and \code{aov_ez} are wrappers for \code{\link[car]{Anova}} and \code{\link{aov}}, the return value is dependent on the \code{return} argument. Per default, an S3 object of class \code{"afex_aov"} is returned containing the following slots: 
 
 \describe{
   \item{\code{"anova_table"}}{An ANOVA table of class \code{c("anova", "data.frame")}.}
@@ -77,13 +77,13 @@ The \link[=afex_aov-methods]{print} method for \code{afex_aov} objects (invisibl
 These functions allow convenient specification of any type of ANOVAs (i.e., purely within-subjects ANOVAs, purely between-subjects ANOVAs, and mixed between-within or split-plot ANOVAs) for data in the \strong{long} format (i.e., one observation per row). If the data has more than one observation per individual and cell of the design (e.g., multiple responses per condition), the data will by automatically aggregated. The default settings reproduce results from commercial statistical pack [...]
 }
 \details{
-\subsection{Details of ANOVA Specification}{
+\subsection{Details of ANOVA Specification}{ 
 \code{aov_ez} will concatenate all between-subject factors using \code{*} (i.e., producing all main effects and interactions) and all covariates by \code{+} (i.e., adding only the main effects to the existing between-subject factors). The within-subject factors do fully interact with all between-subject factors and covariates. This is essentially identical to the behavior of SPSS's \code{glm} function.
 
 The \code{formula}s for \code{aov_car} or \code{aov_4} must contain a single \code{Error} term specifying the \code{ID} column and potential within-subject factors (you can use \code{\link{mixed}} for running mixed-effects models with multiple error terms). Factors outside the \code{Error} term are treated as between-subject factors (the within-subject factors specified in the \code{Error} term are ignored outside the \code{Error} term; in other words, it is not necessary to specify them [...]
 Suppressing the intercept (i.e, via \code{0 +} or \code{- 1}) is ignored. Specific specifications of effects (e.g., excluding terms with \code{-} or using \code{^}) could be okay but is not tested. Using the \code{\link{I}} or \code{\link{poly}} function within the formula is not tested and not supported!
 
-To run an ANCOVA you need to set \code{factorize = FALSE} and make sure that all variables have the correct type (i.e., factors are factors and numeric variables are numeric and centered).
+To run an ANCOVA you need to set \code{factorize = FALSE} and make sure that all variables have the correct type (i.e., factors are factors and numeric variables are numeric and centered). 
 
 Note that the default behavior is to include calculation of the effect size generalized eta-squared for which \strong{all non-manipluated (i.e., observed)} variables need to be specified via the \code{observed} argument to obtain correct results. When changing the effect size to \code{"pes"} (partial eta-squared) or \code{"none"} via \code{anova_table} this becomes unnecessary.
 
@@ -91,12 +91,12 @@ If \code{check.contrasts = TRUE}, contrasts will be set to \code{"contr.sum"} fo
 }
 
 \subsection{Statistical Issues}{
-\strong{Type 3 sums of squares are default in \pkg{afex}.} While some authors argue that so-called type 3 sums of squares are dangerous and/or problematic (most notably Venables, 2000), they are the default in many commercial statistical application such as SPSS or SAS. Furthermore, statisticians with an applied perspective recommend type 3 tests (e.g., Maxwell and Delaney, 2004). Consequently, they are the default for the ANOVA functions described here. For some more discussion on this  [...]
+\strong{Type 3 sums of squares are default in \pkg{afex}.} While some authors argue that so-called type 3 sums of squares are dangerous and/or problematic (most notably Venables, 2000), they are the default in many commercial statistical application such as SPSS or SAS. Furthermore, statisticians with an applied perspective recommend type 3 tests (e.g., Maxwell and Delaney, 2004). Consequently, they are the default for the ANOVA functions described here. For some more discussion on this  [...]
 
-Note that lower order effects (e.g., main effects) in type 3 ANOVAs are only meaningful with \href{http://www.ats.ucla.edu/stat/mult_pkg/faq/general/effect.htm}{effects coding}. That is, contrasts should be set to \code{\link{contr.sum}} to obtain meaningful results. This is imposed automatically for the functions discussed here as long as \code{check.contrasts} is \code{TRUE} (the default). I nevertheless recommend to set the contrasts globally to \code{contr.sum} via running \code{\lin [...]
+Note that lower order effects (e.g., main effects) in type 3 ANOVAs are only meaningful with \href{http://www.ats.ucla.edu/stat/mult_pkg/faq/general/effect.htm}{effects coding}. That is, contrasts should be set to \code{\link{contr.sum}} to obtain meaningful results. This is imposed automatically for the functions discussed here as long as \code{check.contrasts} is \code{TRUE} (the default). I nevertheless recommend to set the contrasts globally to \code{contr.sum} via running \code{\lin [...]
 }
 
-\subsection{Follow-Up Contrasts and Post-Hoc Tests}{
+\subsection{Follow-Up Contrasts and Post-Hoc Tests}{ 
 The S3 object returned per default can be directly passed to \code{lsmeans::lsmeans} for further analysis. This allows to test any type of contrasts that might be of interest independent of whether or not this contrast involves between-subject variables, within-subject variables, or a combination thereof. The general procedure to run those contrasts is the following (see Examples for a full example):
 
  \enumerate{
@@ -106,13 +106,13 @@ The S3 object returned per default can be directly passed to \code{lsmeans::lsme
    \item Test the contrast on the reference grid using \code{\link[lsmeans]{contrast}}. For example: \code{contrast(r, con1)}
    \item To control for multiple testing p-value adjustments can be specified. For example the Bonferroni-Holm correction: \code{contrast(r, con1, adjust = "holm")}
  }
-
+ 
  Note that \pkg{lsmeans} allows for a variety of advanced settings and simplifiations, for example: all pairwise comparison of a single factor using one command (e.g., \code{lsmeans(x, "a", contr = "pairwise")}) or advanced control for multiple testing by passing objects to \pkg{multcomp}. A comprehensive overview of the functionality is provided in the accompanying vignettes (see \href{http://cran.r-project.org/package=lsmeans}{here}).
-
+ 
  A caveat regarding the use of \pkg{lsmeans} concerns the assumption of sphericity for ANOVAs including within-subjects/repeated-measures factors (with more than two levels). While the ANOVA tables per default report results using the Greenhousse-Geisser correction, no such correction is available when using \pkg{lsmeans}. This may result in anti-conservative tests.
-
+ 
  \pkg{lsmeans} is loaded/attached automatically when loading \pkg{afex} via \code{library} or \code{require}.
-}
+}  
 
 \subsection{Methods for \code{afex_aov} Objects}{
 A full overview over the methods provided for \code{afex_aov} objects is provided in the corresponding help page: \code{\link{afex_aov-methods}}. The probably most important ones for end-users are \code{summary} and \code{anova}.
@@ -164,6 +164,9 @@ aov_ez("id", "value", obk.long, between = c("treatment", "gender"),
         within = c("phase", "hour"), observed = "gender")
 
 # the three calls return the same ANOVA table:
+## Anova Table (Type 3 tests)
+##
+## Response: value
 ##                         Effect          df   MSE         F  ges p.value
 ## 1                    treatment       2, 10 22.81    3.94 +  .20     .05
 ## 2                       gender       1, 10 22.81    3.66 +  .11     .08
@@ -180,7 +183,8 @@ aov_ez("id", "value", obk.long, between = c("treatment", "gender"),
 ## 13        treatment:phase:hour 7.19, 35.96  2.67      0.35 .009     .93
 ## 14           gender:phase:hour 3.60, 35.96  2.67      0.93  .01     .45
 ## 15 treatment:gender:phase:hour 7.19, 35.96  2.67      0.74  .02     .65
-
+##
+## Sphericity correction method: GG 
 
 # "numeric" variables are per default converted to factors (as long as factorize = TRUE):
 obk.long$hour2 <- as.numeric(as.character(obk.long$hour))
@@ -229,6 +233,11 @@ aov_car(value ~ treatment * gender + Error(id/(phase*hour)),
         data = obk.long,observed = "gender", 
         anova_table = list(correction = "none", MSE = FALSE))
 
+# add p-value adjustment for all effects (see Cramer et al., 2015, PB&R)
+aov_ez("id", "value", obk.long, between = "treatment", 
+       within = c("phase", "hour"), 
+       anova_table = list(p.adjust.method = "holm"))
+
 
 ###########################
 ## 2: Follow-up Analysis ##
@@ -314,6 +323,8 @@ Henrik Singmann
 The design of these functions was influenced by \code{\link[ez]{ezANOVA}} from package \pkg{ez}.
 }
 \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.  \emph{Psychonomic Bulletin & Review}, 1–8. doi:\href{http://doi.org/10.3758/s13423-015-0913-5}{10.3758/s13423-015-0913-5} 
+
 Maxwell, S. E., & Delaney, H. D. (2004). \emph{Designing Experiments and Analyzing Data: A Model-Comparisons Perspective}. Mahwah, N.J.: Lawrence Erlbaum Associates.
 
 Venables, W.N. (2000). \emph{Exegeses on linear models}. Paper presented to the S-Plus User's Conference, Washington DC, 8-9 October 1998, Washington, DC. Available from: \url{http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf}
diff --git a/man/compare.2.vectors.Rd b/man/compare.2.vectors.Rd
index 24c34ed..9f38fd3 100644
--- a/man/compare.2.vectors.Rd
+++ b/man/compare.2.vectors.Rd
@@ -1,14 +1,14 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/compare.2.vectors.R
 \encoding{UTF-8}
 \name{compare.2.vectors}
 \alias{compare.2.vectors}
 \title{Compare two vectors using various tests.}
 \usage{
-compare.2.vectors(x, y, paired = FALSE, na.rm = FALSE,
-     tests = c("parametric", "nonparametric"), coin = TRUE,
-     alternative = "two.sided",
-     perm.distribution = approximate(100000),
+compare.2.vectors(x, y, paired = FALSE, na.rm = FALSE, 
+     tests = c("parametric", "nonparametric"), coin = TRUE, 
+     alternative = "two.sided", 
+     perm.distribution = approximate(100000), 
      wilcox.exact = NULL, wilcox.correct = TRUE)
 }
 \arguments{
@@ -39,14 +39,14 @@ a list with up to two elements (i.e., \code{paramteric} and/or \code{nonparamter
 Compares two vectors \code{x} and \code{y} using t-test, Welch-test (also known as Satterthwaite), Wilcoxon-test, and a permutation test implemented in \pkg{coin}.
 }
 \details{
-The \code{parametric} tests (currently) only contain the \emph{t}-test and Welch/Statterwaithe/Smith/unequal variance \emph{t}-test implemented in \code{\link{t.test}}. The latter one is only displayed if \code{paired = FALSE}.
+The \code{parametric} tests (currently) only contain the \emph{t}-test and Welch/Statterwaithe/Smith/unequal variance \emph{t}-test implemented in \code{\link{t.test}}. The latter one is only displayed if \code{paired = FALSE}. 
 
-The \code{nonparametric} tests (currently) contain the Wilcoxon test implemented in \code{\link{wilcox.test}} (\code{stats::Wilcoxon}) and (if \code{coin = TRUE}) the following tests implemented in \pkg{coin}:
+The \code{nonparametric} tests (currently) contain the Wilcoxon test implemented in \code{\link{wilcox.test}} (\code{stats::Wilcoxon}) and (if \code{coin = TRUE}) the following tests implemented in \pkg{coin}: 
 
 \itemize{
 \item a \code{permutation} test \code{\link{oneway_test}} (the only test in this selction not using a rank transformation),
-\item the \code{Wilcoxon} test \code{\link{wilcox_test}} (\code{coin::Wilcoxon}), and
-\item the \code{median} test \code{median_test}.
+\item the \code{Wilcoxon} test \code{\link{wilcox_test}} (\code{coin::Wilcoxon}), and 
+\item the \code{median} test \code{median_test}. 
 }
 Note that the two implementations of the Wilcoxon test probably differ. This is due to differences in the calculation of the Null distributions.
 }
diff --git a/man/deprecated.Rd b/man/deprecated.Rd
index 9e4d747..2a0fff9 100644
--- a/man/deprecated.Rd
+++ b/man/deprecated.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/deprecated.R
 \name{aov.car}
 \alias{afex-deprecated}
@@ -19,7 +19,7 @@ aov4(...)
 }
 \description{
 These functions have been renamed and deprecated in \pkg{afex}:
-\code{aov.car()} (use \code{\link{aov_car}()}),
+\code{aov.car()} (use \code{\link{aov_car}()}), 
 \code{ez.glm()} (use \code{\link{aov_ez}()}),
 \code{aov4()} (use \code{\link{aov_4}()}).
 }
diff --git a/man/ems.Rd b/man/ems.Rd
index 373876c..f51bde1 100644
--- a/man/ems.Rd
+++ b/man/ems.Rd
@@ -1,8 +1,10 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/ems.R
 \name{ems}
 \alias{ems}
-\title{Expected values of mean squares for factorial designs}
+\title{Expected values of mean squares for factorial designs
+ 
+ Implements the Cornfield-Tukey algorithm for deriving the expected values of the mean squares for factorial designs.}
 \usage{
 ems(design, nested = NULL, random = NULL)
 }
@@ -17,7 +19,9 @@ ems(design, nested = NULL, random = NULL)
 The returned value is a formatted table where the rows represent the mean squares, the columns represent the variance components that comprise the various mean squares, and the entries in each cell represent the terms that are multiplied and summed to form the expectation of the mean square for that row. Each term is either the lower-case version of one of the experimental factors, which indicates the number of levels for that factor, or a "1", which means the variance component for that [...]
 }
 \description{
-Implements the Cornfield-Tukey algorithm for deriving the expected values of the mean squares for factorial designs.
+Expected values of mean squares for factorial designs
+ 
+ Implements the Cornfield-Tukey algorithm for deriving the expected values of the mean squares for factorial designs.
 }
 \note{
 Names for factors or parameters should only be of length 1 as they are simply concatenated in the returned table.
diff --git a/man/ks2013.3.Rd b/man/ks2013.3.Rd
index 04f93e5..ed54747 100644
--- a/man/ks2013.3.Rd
+++ b/man/ks2013.3.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/ks2013.3-data.R
 \docType{data}
 \encoding{UTF-8}
diff --git a/man/md_12.1.Rd b/man/md_12.1.Rd
index cb328da..8089fed 100644
--- a/man/md_12.1.Rd
+++ b/man/md_12.1.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/md_12.1-data.R
 \docType{data}
 \encoding{UTF-8}
@@ -20,30 +20,32 @@ Description from pp. 573:
 
 Suppose that a perceptual psychologist studying the visual system was interested in determining the
 extent to which interfering visual stimuli slow the ability to recognize letters. Subjects are
-brought into a laboratory and seated in front of a tachistoscope. Subjects are told that they will
-see either the letter T or the letter I displayed on the screen. In some trials, the letter appears
-by itself, but in other trials, the target letter is embedded in a group of other letters. This
-variation in the display constitutes the first factor, which is referred to as noise. The noise
-factor has two levels?absent and present. The other factor varied by the experimenter is where in
-the display the target letter appears. This factor, which is called angle, has three levels. The
-target letter is either shown at the center of the screen (i.e., 0° off-center, where the subject
-has been instructed to fixate), 4° off-center or 8° off-center (in each case, the deviation from the
-center varies randomly between left and right). Table 12.1 presents hypothetical data for 10
-subjects. As usual, the sample size is kept small to make the calculations easier to follow. The
-dependent measure is reaction time (latency), measured in milliseconds (ms), required by a subject
-to identify the correct target letter. Notice that each subject has six scores, one for each
-combination of the 2 x 3 design. In an actual perceptual experiment, each of these six scores would
-itself be the mean score for that subject across a number of trials in the particular condition.
-Although "trials" could be used as a third within-subjects factor in such a situation, more
-typically trials are simply averaged over to obtain a more stable measure of the individual's
+brought into a laboratory and seated in front of a tachistoscope. Subjects are told that they will 
+see either the letter T or the letter I displayed on the screen. In some trials, the letter appears 
+by itself, but in other trials, the target letter is embedded in a group of other letters. This 
+variation in the display constitutes the first factor, which is referred to as noise. The noise 
+factor has two levels?absent and present. The other factor varied by the experimenter is where in 
+the display the target letter appears. This factor, which is called angle, has three levels. The 
+target letter is either shown at the center of the screen (i.e., 0° off-center, where the subject 
+has been instructed to fixate), 4° off-center or 8° off-center (in each case, the deviation from the 
+center varies randomly between left and right). Table 12.1 presents hypothetical data for 10 
+subjects. As usual, the sample size is kept small to make the calculations easier to follow. The 
+dependent measure is reaction time (latency), measured in milliseconds (ms), required by a subject 
+to identify the correct target letter. Notice that each subject has six scores, one for each 
+combination of the 2 x 3 design. In an actual perceptual experiment, each of these six scores would 
+itself be the mean score for that subject across a number of trials in the particular condition. 
+Although "trials" could be used as a third within-subjects factor in such a situation, more 
+typically trials are simply averaged over to obtain a more stable measure of the individual's 
 performance in each condition.
 }
 \examples{
 data(md_12.1)
 
 # Table 12.5 (p. 578):
-aov_ez("id", "rt", md_12.1, within = c("angle", "noise"),
+aov_ez("id", "rt", md_12.1, within = c("angle", "noise"), 
        args.return=list(correction = "none", es = "none"))
+
+
 }
 \keyword{dataset}
 
diff --git a/man/md_15.1.Rd b/man/md_15.1.Rd
index fc414c5..7883caf 100644
--- a/man/md_15.1.Rd
+++ b/man/md_15.1.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/md_15.1-data.R
 \docType{data}
 \encoding{UTF-8}
@@ -61,6 +61,7 @@ contrasts(md_15.1$timecat) <- contr.poly
 # growth curve model
 (t15.6 <- mixed(iq ~ time + (1+time|id),data=md_15.1))
 summary(t15.6$full.model)
+
 }
 \author{
 R code for examples written by Ulf Mertens and Henrik Singmann
diff --git a/man/md_16.1.Rd b/man/md_16.1.Rd
index 41bdf2c..b6202d2 100644
--- a/man/md_16.1.Rd
+++ b/man/md_16.1.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/md_16.1-data.R
 \docType{data}
 \encoding{UTF-8}
@@ -34,6 +34,7 @@ summary(mixed1_orig$full.model)
 # but estimates and t-values for the fixed effects parameters change.
 (mixed1 <- mixed(severity ~ sex + (1|id), md_16.1))
 summary(mixed1$full.model)
+
 }
 \keyword{dataset}
 
diff --git a/man/md_16.4.Rd b/man/md_16.4.Rd
index 783e30c..54ae3f9 100644
--- a/man/md_16.4.Rd
+++ b/man/md_16.4.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/md_16.4-data.R
 \docType{data}
 \encoding{UTF-8}
@@ -33,6 +33,8 @@ str(md_16.4)
 # p-values (almost) hold:
 (mixed2 <- mixed(induct ~ cond + (1|room:cond), md_16.4))
 # (1|room:cond) is needed because room is nested within cond.
+
+
 }
 \keyword{dataset}
 
diff --git a/man/mixed.Rd b/man/mixed.Rd
index 8ed9dfd..06f9ff1 100644
--- a/man/mixed.Rd
+++ b/man/mixed.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/mixed.R
 \encoding{UTF-8}
 \name{mixed}
@@ -40,7 +40,7 @@ lmer_alt(formula, data, check.contrasts = FALSE, ...)
 
 \item{cl}{A vector identifying a cluster; used for distributing the estimation of the different models using several cores. See examples. If \code{ckeck.contrasts}, mixed sets the current contrasts (\code{getOption("contrasts")}) at the nodes. Note this does \emph{not} distribute calculation of p-values (e.g., when using \code{method = "PB"}) across the cluster. Use \code{args.test} for this.}
 
-\item{return}{the default is to return an object of class \code{"mixed"}. \code{return = "merMod"} will skip the calculation of all submodels and p-values and simply return the full model fitted with lmer. Can be useful in combination with \code{expand_re = TRUE} which allows to use "||" with factors.}
+\item{return}{the default is to return an object of class \code{"mixed"}. \code{return = "merMod"} will skip the calculation of all submodels and p-values and simply return the full model fitted with lmer. Can be useful in combination with \code{expand_re = TRUE} which allows to use "||" with factors. \code{return = "data"} will not fit any models but just return the data that would have been used for fitting the model. Can be used in combination with \code{expand_re = TRUE} and \code{\l [...]
 
 \item{...}{further arguments (such as \code{weights}/\code{family}) passed to \code{\link{lmer}}/\code{\link{glmer}}.}
 }
@@ -151,11 +151,14 @@ sk_m1 <- mixed(response ~ instruction*inference*type+(inference*type|id), sk2_af
 
 sk_m1 # prints ANOVA table with nicely rounded numbers (i.e., as characters)
 nice(sk_m1)  # returns the same but without printing potential warnings
-
 anova(sk_m1) # returns and prints numeric ANOVA table (i.e., not-rounded)
-
 summary(sk_m1) # lmer summary of full model
 
+# suppressing correlation among random slopes:
+# very similar results, but significantly faster and often better convergence. 
+sk_m2 <- mixed(response ~ instruction*inference*type+(inference*type||id), sk2_aff,
+               expand_re = TRUE)
+sk_m2
 
 ## mixed objects can be passed to lsmeans directly:
 
@@ -355,7 +358,7 @@ Judd, C. M., Westfall, J., & Kenny, D. A. (2012). Treating stimuli as a random f
 Maxwell, S. E., & Delaney, H. D. (2004). \emph{Designing experiments and analyzing data: a model-comparisons perspective.} Mahwah, N.J.: Lawrence Erlbaum Associates.
 }
 \seealso{
-\code{\link{aov_ez}} and \code{\link{aov_car}} for convenience functions to analyze experimental deisgns with classical ANOVA or ANCOVA wrapping \code{\link[car]{Anova}}.
+\code{\link{aov_ez}} and \code{\link{aov_car}} for convenience functions to analyze experimental deisgns with classical ANOVA or ANCOVA wrapping \code{\link[car]{Anova}}. 
 
 see the following for the data sets from Maxwell and Delaney (2004) used and more examples: \code{\link{md_15.1}}, \code{\link{md_16.1}}, and \code{\link{md_16.4}}.
 }
diff --git a/man/nice.Rd b/man/nice.Rd
index cc0cc8b..8e84f49 100644
--- a/man/nice.Rd
+++ b/man/nice.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/nice.R
 \encoding{UTF-8}
 \name{nice}
@@ -6,22 +6,26 @@
 \alias{nice.afex_aov}
 \alias{nice.anova}
 \alias{nice.mixed}
+\alias{print.nice_table}
 \title{Make nice ANOVA table for printing.}
 \usage{
 nice(object, ...)
 
-\method{nice}{afex_aov}(object, es = afex_options("es_aov"),
-  observed = NULL, correction = afex_options("correction_aov"),
-  MSE = TRUE, intercept = FALSE, sig.symbols = c(" +", " *", " **",
-  " ***"), p.adjust.method = NULL, ...)
+\method{nice}{afex_aov}(object, es = NULL,
+  observed = attr(object$anova_table, "observed"),
+  correction = attr(object$anova_table, "correction"), MSE = NULL,
+  intercept = NULL, p.adjust.method = attr(object$anova_table,
+  "p.adjust.method"), sig.symbols = c(" +", " *", " **", " ***"), ...)
 
 \method{nice}{anova}(object, MSE = TRUE, intercept = FALSE,
   sig.symbols = c(" +", " *", " **", " ***"), ...)
 
 \method{nice}{mixed}(object, sig.symbols = c(" +", " *", " **", " ***"), ...)
+
+\method{print}{nice_table}(x, ...)
 }
 \arguments{
-\item{object}{An object of class \code{"Anova.mlm"} or \code{"anova"} as returned from \code{\link[car]{Anova}} or the \pkg{afex} ANOVA functions (see \code{\link{aov_car}}).}
+\item{object, x}{An object of class \code{"afex_aov"} (see \code{\link{aov_car}}) or of class \code{"mixed"} (see \code{\link{mixed}}) as returned from the \pkg{afex} functions. Alternatively, an object of class \code{"Anova.mlm"} or \code{"anova"} as returned from \code{\link[car]{Anova}}.}
 
 \item{...}{currently ignored.}
 
@@ -35,12 +39,12 @@ nice(object, ...)
 
 \item{intercept}{logical. Should intercept (if present) be included in the ANOVA table? Default is \code{FALSE} which hides the intercept.}
 
-\item{sig.symbols}{Character. What should be the symbols designating significance? When entering an vector with \code{length(sig.symbol) < 4} only those elements of the default (\code{c(" +", " *", " **", " ***")}) will be replaced. \code{sig.symbols = ""} will display the stars but not the \code{+}, \code{sig.symbols = rep("", 4)} will display no symbols.}
-
 \item{p.adjust.method}{\code{character} indicating if p-values for individual effects should be adjusted for multiple comparisons (see \link[stats]{p.adjust} and details). The default \code{NULL} corresponds to no adjustment.}
+
+\item{sig.symbols}{Character. What should be the symbols designating significance? When entering an vector with \code{length(sig.symbol) < 4} only those elements of the default (\code{c(" +", " *", " **", " ***")}) will be replaced. \code{sig.symbols = ""} will display the stars but not the \code{+}, \code{sig.symbols = rep("", 4)} will display no symbols.}
 }
 \value{
-A \code{data.frame} with the ANOVA table consisting of characters. The columns that are always present are: \code{Effect}, \code{df} (degrees of freedom), \code{F}, and \code{p}.
+A \code{data.frame} of class \code{nice_table} with the ANOVA table consisting of characters. The columns that are always present are: \code{Effect}, \code{df} (degrees of freedom), \code{F}, and \code{p}.
 
 \code{ges} contains the generalized eta-squared effect size measure (Bakeman, 2005), \code{pes} contains partial eta-squared (if requested).
 }
@@ -58,6 +62,7 @@ Exploratory ANOVA, for which no detailed hypotheses have been specified a priori
 \code{p.adjust.method} defaults to the method specified in the call to \code{\link{aov_car}} in \code{anova_table}. If no method was specified and \code{p.adjust.method = NULL} p-values are not adjusted.
 }
 \examples{
+
 ## example from Olejnik & Algina (2003)
 # "Repeated Measures Design" (pp. 439):
 data(md_12.1)
@@ -87,6 +92,7 @@ print(ascii(full, include.rownames = FALSE, caption = "ANOVA 1"), type = "org")
 require(xtable)
 print.xtable(xtable(full, caption = "ANOVA 2"), include.rownames = FALSE)
 }
+
 }
 \author{
 The code for calculating generalized eta-squared was written by Mike Lawrence.\cr Everything else was written by Henrik Singmann.
diff --git a/man/obk.long.Rd b/man/obk.long.Rd
index 19478be..741678a 100644
--- a/man/obk.long.Rd
+++ b/man/obk.long.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/obk.long-data.R
 \docType{data}
 \encoding{UTF-8}
diff --git a/man/round_ps.Rd b/man/round_ps.Rd
index 38441e6..d9156c6 100644
--- a/man/round_ps.Rd
+++ b/man/round_ps.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/round_ps.R
 \encoding{UTF-8}
 \name{round_ps}
@@ -24,6 +24,7 @@ round_ps(runif(10, 0, .01))
 round_ps(runif(10, 0, .001))
 
 round_ps(0.0000000099)
+
 }
 \author{
 Henrik Singmann
diff --git a/man/set_sum_contrasts.Rd b/man/set_sum_contrasts.Rd
index c10e670..ea63efd 100644
--- a/man/set_sum_contrasts.Rd
+++ b/man/set_sum_contrasts.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/set_contrasts.R
 \name{set_sum_contrasts}
 \alias{set_default_contrasts}
diff --git a/man/sk2011.1.Rd b/man/sk2011.1.Rd
index 306b850..1e53d04 100644
--- a/man/sk2011.1.Rd
+++ b/man/sk2011.1.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/sk2011.1-data.R
 \docType{data}
 \encoding{UTF-8}
@@ -34,12 +34,14 @@ Note that the factor `plausibility` is not present in the original manuscript, t
 data(sk2011.1)
 
 # Table 1 (p. 264):
-aov_ez("id", "response", sk2011.1[ sk2011.1$what == "affirmation",],
-       within = c("inference", "type"), between = "instruction",
+aov_ez("id", "response", sk2011.1[ sk2011.1$what == "affirmation",], 
+       within = c("inference", "type"), between = "instruction", 
        args.return=(es = "pes"))
-aov_ez("id", "response", sk2011.1[ sk2011.1$what == "denial",],
-       within = c("inference", "type"), between = "instruction",
+aov_ez("id", "response", sk2011.1[ sk2011.1$what == "denial",], 
+       within = c("inference", "type"), between = "instruction", 
        args.return=(es = "pes"))
+
+ 
 }
 \keyword{dataset}
 
diff --git a/man/sk2011.2.Rd b/man/sk2011.2.Rd
index 66ddc62..086747c 100644
--- a/man/sk2011.2.Rd
+++ b/man/sk2011.2.Rd
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
+% Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/sk2011.2-data.R
 \docType{data}
 \encoding{UTF-8}
diff --git a/tests/testthat/lmm_old_object.rda b/tests/testthat/lmm_old_object.rda
new file mode 100644
index 0000000..37ee535
Binary files /dev/null and b/tests/testthat/lmm_old_object.rda differ
diff --git a/tests/testthat/test-aov_car-bugs.R b/tests/testthat/test-aov_car-bugs.R
index 81f8752..d6c2a24 100644
--- a/tests/testthat/test-aov_car-bugs.R
+++ b/tests/testthat/test-aov_car-bugs.R
@@ -182,13 +182,17 @@ test_that("variable names longer", {
   orig <- aov_car(value ~ treatment * gender + age + Error(id/phase*hour), data = obk.long, factorize=FALSE, observed = "gender")
   v1 <- aov_car(value ~ gender2 * gender + age + Error(id/phase*hour), data = obk.long, factorize=FALSE, observed = "gender")
   v2 <- aov_car(value ~ gender2 * gender + age + Error(id/phase*hour), data = obk.long, factorize=FALSE, observed = "gender2")
+  expect_equivalent(orig$anova_table, v1$anova_table)
   expect_identical(nice(orig)[,-1], nice(v1)[,-1])
-  expect_identical(nice(orig)[,-c(1)], nice(v2)[,-c(1)])
+  expect_identical(nice(orig)[,c("df", "MSE", "F", "p.value")], nice(v2)[,c("df", "MSE", "F", "p.value")])
+  expect_equivalent(orig$anova_table[,c("num Df", "den Df", "MSE", "F", "Pr(>F)")], v2$anova_table[c("num Df", "den Df", "MSE", "F", "Pr(>F)")])
 })
 
 test_that("works with dplyr data.frames (see https://github.com/singmann/afex/issues/6):", {
-  require(dplyr)
-  data(md_12.1)
-  md2 <- tbl_df(md_12.1)
-  expect_is(aov_ez("id", "rt", md2, within = c("angle", "noise"), anova_table=list(correction = "none", es = "none")), "afex_aov")
+  if (getRversion() >= "3.1.2") {
+    require(dplyr)
+    data(md_12.1)
+    md2 <- tbl_df(md_12.1)
+    expect_is(aov_ez("id", "rt", md2, within = c("angle", "noise"), anova_table=list(correction = "none", es = "none")), "afex_aov") 
+  }
 })
diff --git a/tests/testthat/test-aov_car-structural.R b/tests/testthat/test-aov_car-structural.R
index f03d5cb..39332cc 100644
--- a/tests/testthat/test-aov_car-structural.R
+++ b/tests/testthat/test-aov_car-structural.R
@@ -40,3 +40,43 @@ test_that("return='aov' works", {
   expect_equal(summary(orig1$Anova, multivariate = FALSE), summary(positive3$Anova, multivariate = FALSE))
   expect_equal(summary(orig1$aov), summary(positive3$aov))
 })
+
+test_that("anova_table attributes", {
+  data(md_12.1)
+  no_attr <- aov_ez("id", "rt", md_12.1, within = c("angle", "noise"), anova_table = list(correction = "none"))
+  
+  expect_that(attr(no_attr$anova_table, "correction"), equals("none"))
+  expect_that(attr(no_attr$anova_table, "p.adjust.method"), equals("none"))
+  expect_output(print(attr(no_attr$anova_table, "observed")), "character\\(0\\)")
+  
+  all_attr <- suppressWarnings(aov_ez("id", "rt", md_12.1, within = c("angle", "noise"), observed = "angle", anova_table=list(correction = "HF", p.adjust.method = "bonferroni")))
+  
+  expect_that(attr(all_attr$anova_table, "correction"), equals("HF"))
+  expect_that(attr(all_attr$anova_table, "p.adjust.method"), equals("bonferroni"))
+  expect_that(attr(all_attr$anova_table, "observed"), equals("angle"))
+  expect_output(print(all_attr), "bonferroni")
+  expect_output(print(all_attr), "HF")
+  
+  expect_false(isTRUE(all.equal(nice(no_attr), suppressWarnings(nice(all_attr)), check.attributes = FALSE)))
+  
+  added_attr <- suppressWarnings(nice(no_attr, correction = "HF", p.adjust = "bonferroni", observed = "angle"))
+  expect_that(suppressWarnings(nice(all_attr)), is_identical_to(added_attr))
+  expect_that(nice(all_attr$anova_table), is_identical_to(added_attr))
+  
+  
+  reset_attr <- nice(no_attr, correction = "none", p.adjust = "none", observed = NULL)
+  expect_that(nice(no_attr), is_identical_to(reset_attr))
+  expect_that(nice(no_attr$anova_table), is_identical_to(reset_attr))
+  
+  # Test support for old afex objects
+  old_afex_object <- default_options <- aov_ez("id", "rt", md_12.1, within = c("angle", "noise"))
+  attr(old_afex_object$anova_table, "observed") <- NULL
+  attr(old_afex_object$anova_table, "correction") <- NULL
+  attr(old_afex_object$anova_table, "p.adjust.method") <- NULL
+  expect_that(nice(old_afex_object), is_identical_to(nice(default_options)))
+  
+  # Test if sphericity correction is set to "none" in the absence of within-subject factors
+  data(obk.long)
+  between_anova <- suppressWarnings(aov_car(value ~ treatment * gender + Error(id), data = obk.long))
+  expect_that(attr(between_anova$anova_table, "correction"), equals("none"))
+})
diff --git a/tests/testthat/test-compare_2_vectors.R b/tests/testthat/test-compare_2_vectors.R
index a9121db..e07f58d 100644
--- a/tests/testthat/test-compare_2_vectors.R
+++ b/tests/testthat/test-compare_2_vectors.R
@@ -4,5 +4,6 @@ context("compare.2.vectors: known bugs")
 test_that("exactly equal mean does not fail", {
   x <- c(0.309, 0.222, 0.293, 0.238, 0.33, 0.215)
   y <- c(0.313, 0.213, 0.306, 0.253, 0.294, 0.228)
-  expect_is(compare.2.vectors(x, y, paired = TRUE),"list")
+  out <- suppressWarnings(compare.2.vectors(x, y, paired = TRUE))
+  expect_is(out,"list")
 })
diff --git a/tests/testthat/test-lsmeans-interface.R b/tests/testthat/test-lsmeans-interface.R
index 969867e..7bad298 100644
--- a/tests/testthat/test-lsmeans-interface.R
+++ b/tests/testthat/test-lsmeans-interface.R
@@ -3,13 +3,13 @@ context("interplay with lsmeans")
 
 test_that("ANOVA functions work with lsmeans", {
   data(sk2011.1)
-  a1 <- aov_ez("id", "response", sk2011.1, between = "instruction", within = c("inference", "plausibility"))
+  a1 <- aov_ez("id", "response", sk2011.1, between = "instruction", within = c("inference", "plausibility"), fun.aggregate = mean)
   expect_is(lsmeans(a1, ~ inference), "lsmobj")
-  a2 <- aov_ez("id", "response", sk2011.1, between = "instruction", within = c("inference"))
+  a2 <- aov_ez("id", "response", sk2011.1, between = "instruction", within = c("inference"), fun.aggregate = mean)
   expect_is(lsmeans(a2, ~ inference), "lsmobj")
-  a3 <- aov_ez("id", "response", sk2011.1, within = c("inference"))
+  a3 <- aov_ez("id", "response", sk2011.1, within = c("inference"), fun.aggregate = mean)
   expect_is(lsmeans(a3, ~ inference), "lsmobj")
-  a4 <- aov_ez("id", "response", sk2011.1, between = "instruction")
+  a4 <- aov_ez("id", "response", sk2011.1, between = "instruction", fun.aggregate = mean)
   expect_is(lsmeans(a4, ~ instruction), "lsmobj")
 })
 
diff --git a/tests/testthat/test-mixed-bugs.R b/tests/testthat/test-mixed-bugs.R
index 7f3cb58..c46c471 100644
--- a/tests/testthat/test-mixed-bugs.R
+++ b/tests/testthat/test-mixed-bugs.R
@@ -9,3 +9,23 @@ test_that("mixed works with long formulas", {
   expect_is(mixed(valuevaluevaluevaluevaluevalue ~ treatmenttreatmenttreatmenttreatmenttreatmenttreatment * phasephasephasephasephasephase * hourhourhourhourhourhour + (1|idididididid), obk2, method = "LRT", progress = FALSE), "mixed")
 })
 
+test_that("nice.mixed and print.mixed can handle old objects", {
+  # created via:
+  #   require(devtools)
+  #   dev_mode()
+  #   install_url("https://cran.rstudio.com/src/contrib/Archive/afex/afex_0.13-145.tar.gz")
+  #   require(afex)
+  #   data(obk.long)
+  #   m1 <- mixed(value ~ treatment * phase + (1|id), obk.long)
+  #   m2 <- mixed(value ~ treatment * phase + (1|id), obk.long, method = "LRT")
+  #   m3 <- mixed(value ~ treatment * phase + (1|id), obk.long, method = "PB")
+  #   save(m1, m2, m3, file = "lmm_old_object.rda")
+  #   dev_mode()
+  load("lmm_old_object.rda")
+  expect_is(suppressWarnings(nice(m1)), "data.frame")
+  expect_is(suppressWarnings(nice(m2)), "data.frame")
+  expect_is(suppressWarnings(nice(m3)), "data.frame")
+  expect_output(suppressWarnings(print(m1)), "treatment")
+  expect_output(suppressWarnings(print(m2)), "treatment")
+  expect_output(suppressWarnings(print(m3)), "treatment")
+})
diff --git a/tests/testthat/test-mixed-structure.R b/tests/testthat/test-mixed-structure.R
index 232f03c..9c7783d 100644
--- a/tests/testthat/test-mixed-structure.R
+++ b/tests/testthat/test-mixed-structure.R
@@ -69,17 +69,19 @@ test_that("mixed, obk.long: LMM with method = PB", {
 })
 
 test_that("mixed, obk.long: multicore loads lme4 and produces the same results", {
-  skip_on_cran()
-  data(obk.long, package = "afex")
-  require(parallel)
-  cl <- makeCluster(rep("localhost", 2)) # make cluster
-  # 1. Obtain fits with multicore:
-  m_mc1 <- mixed(value ~ treatment +(phase|id), data = obk.long, method = "LRT", cl = cl, control = lmerControl(optCtrl=list(maxfun = 100000)), progress=FALSE)
-  cl_search <- clusterEvalQ(cl, search())
-  stopCluster(cl)  
-  m_mc2 <- mixed(value ~ treatment +(phase|id), data = obk.long, method = "LRT", control = lmerControl(optCtrl=list(maxfun = 100000)), progress=FALSE)
-  expect_that(all(vapply(cl_search, function(x) any(grepl("^package:lme4$", x)), NA)), is_true())
-  expect_that(m_mc1, equals(m_mc2, check.attributes = FALSE))
+  if (packageVersion("testthat") >= "0.9") {
+    skip_on_cran()
+    data(obk.long, package = "afex")
+    require(parallel)
+    cl <- makeCluster(rep("localhost", 2)) # make cluster
+    # 1. Obtain fits with multicore:
+    m_mc1 <- mixed(value ~ treatment +(phase|id), data = obk.long, method = "LRT", cl = cl, control = lmerControl(optCtrl=list(maxfun = 100000)), progress=FALSE)
+    cl_search <- clusterEvalQ(cl, search())
+    stopCluster(cl)  
+    m_mc2 <- mixed(value ~ treatment +(phase|id), data = obk.long, method = "LRT", control = lmerControl(optCtrl=list(maxfun = 100000)), progress=FALSE)
+    expect_that(all(vapply(cl_search, function(x) any(grepl("^package:lme4$", x)), NA)), is_true())
+    expect_that(m_mc1, equals(m_mc2, check.attributes = FALSE))
+  }
 })
 
 test_that("print(mixed) works: only 1 or 2 fixed effects with all methods", {
@@ -150,13 +152,39 @@ test_that("mixed: expand_re argument, return = 'merMod'", {
 })
 
 test_that("mixed: expand_re argument (longer)", {
-  testthat::skip_on_cran()
-  data("ks2013.3")
-  m4 <- mixed(response ~ validity + (believability*validity||id) + (validity*condition|content), ks2013.3, expand_re = TRUE, method = "LRT", control = lmerControl(optCtrl = list(maxfun=1e6)), progress=FALSE)
-  m5 <- mixed(response ~ validity + (believability*validity|id) + (validity*condition||content), ks2013.3, method = "LRT", control = lmerControl(optCtrl = list(maxfun=1e6)), expand_re = TRUE, progress=FALSE)
-  expect_identical(length(unlist(summary(m4)$varcor[-7])), nrow(summary(m5)$varcor$id))
-  expect_identical(length(unlist(summary(m5)$varcor[-1])), nrow(summary(m4)$varcor$content))
-  expect_equal(attr(summary(m5)$varcor, "sc"), attr(summary(m4)$varcor, "sc"), tolerance = 0.02)
+  if (packageVersion("testthat") >= "0.9") {
+    testthat::skip_on_cran()
+    data("ks2013.3")
+    m4 <- mixed(response ~ validity + (believability*validity||id) + (validity*condition|content), ks2013.3, expand_re = TRUE, method = "LRT", control = lmerControl(optCtrl = list(maxfun=1e6)), progress=FALSE)
+    m5 <- suppressWarnings(mixed(response ~ validity + (believability*validity|id) + (validity*condition||content), ks2013.3, method = "LRT", control = lmerControl(optCtrl = list(maxfun=1e6)), expand_re = TRUE, progress=FALSE))
+    expect_identical(length(unlist(summary(m4)$varcor[-7])), nrow(summary(m5)$varcor$id))
+    expect_identical(length(unlist(summary(m5)$varcor[-1])), nrow(summary(m4)$varcor$content))
+    expect_equal(attr(summary(m5)$varcor, "sc"), attr(summary(m4)$varcor, "sc"), tolerance = 0.02)
+  }
 })
 
 
+test_that("mixed: return=data, expand_re argument, and allFit", {
+  if (packageVersion("testthat") >= "0.9") {
+    testthat::skip_on_cran()
+    data("ks2013.3")
+    ks2013.3_tmp <- ks2013.3
+    m6 <- mixed(response ~ validity + (believability*validity||id), ks2013.3_tmp, expand_re = TRUE, method = "LRT", control = lmerControl(optCtrl = list(maxfun=1e6)), progress=FALSE, return = "merMod")
+    m6_all_1 <- allFit(m6, verbose = FALSE, data = ks2013.3_tmp)
+    expect_output(print(m6_all_1$`bobyqa.`), "object 're1.believability1' not found")
+    ks2013.3_tmp <- mixed(response ~ validity + (believability*validity||id), ks2013.3_tmp, expand_re = TRUE, method = "LRT", control = lmerControl(optCtrl = list(maxfun=1e6)), progress=FALSE, return = "data")
+    m6_all_2 <- suppressWarnings(allFit(m6, verbose = FALSE, data = ks2013.3_tmp))
+    expect_is(m6_all_2$`bobyqa.`, "merMod")
+    expect_is(m6_all_2$`Nelder_Mead.`, "merMod") 
+  }
+})
+
+
+test_that("mixed: return=data works", {
+  data("ks2013.3")
+  ks2013.3_tmp <- ks2013.3
+  ks2013.3_tmp <- mixed(response ~ validity + (believability*validity||id), ks2013.3_tmp, expand_re = TRUE, method = "LRT", control = lmerControl(optCtrl = list(maxfun=1e6)), progress=FALSE, return = "data")
+  expect_is(ks2013.3_tmp, "data.frame")
+  if (packageVersion("testthat") >= "0.11.0.9000") expect_gt(ncol(ks2013.3_tmp), ncol(ks2013.3))
+  expect_output(print(colnames(ks2013.3_tmp)), "re1.believability1_by_validity1")
+})

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/r-cran-afex.git



More information about the debian-science-commits mailing list