diff --git a/dev.R b/dev.R index b45ed61..b23b5de 100644 --- a/dev.R +++ b/dev.R @@ -53,7 +53,7 @@ roxy.package( person(given=\"Jonathan\", family=\"Love\", role=c(\"ctb\")) )", Depends = "R (>= 3.1.0), lme4 (>= 1.1-8), lsmeans (>= 2.17)", - Suggests = "xtable, parallel, plyr, optimx, nloptr, knitr, rmarkdown, lattice, latticeExtra, multcomp, testthat, mlmRev, dplyr, tidyr, dfoptim, Matrix", + Suggests = "xtable, parallel, plyr, optimx, nloptr, knitr, rmarkdown, lattice, latticeExtra, multcomp, testthat, mlmRev, dplyr, tidyr, dfoptim, Matrix, psych", Imports = "stringr, coin, pbkrtest (>= 0.4-1), lmerTest, car, reshape2, stats, methods", Description = "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), 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 or Satterthwaite 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 = "http://afex.singmann.science/, https://github.com/singmann/afex", diff --git a/tests/testthat/test-mixed-bugs.R b/tests/testthat/test-mixed-bugs.R index e1bcd00..cde7197 100644 --- a/tests/testthat/test-mixed-bugs.R +++ b/tests/testthat/test-mixed-bugs.R @@ -47,6 +47,7 @@ test_that("nice.mixed, print.mixed, and anova.mixed can handle objects with full }) test_that("lmer_alt works with GLMMs", { + skip_if_not_installed("mlmRev") if (require("mlmRev")) { expect_that(lmer_alt(use ~ age*urban + (1 | district), family = binomial, data = Contraception, progress=FALSE), is_a("glmerMod")) } diff --git a/tests/testthat/test-mixed-structure.R b/tests/testthat/test-mixed-structure.R index 192efc2..2071f30 100644 --- a/tests/testthat/test-mixed-structure.R +++ b/tests/testthat/test-mixed-structure.R @@ -58,6 +58,7 @@ test_that("mixed, obk.long: type 2 and LRTs", { }) test_that("mixed, mlmRev: type 3 and 2 LRTs for GLMMs", { + skip_if_not_installed("mlmRev") if (require("mlmRev")) { suppressWarnings(gm1 <- mixed(use ~ age*urban + (1 | district), family = binomial, data = Contraception, method = "LRT", progress=FALSE)) suppressWarnings(gm2 <- mixed(use ~ age*urban + (1 | district), family = binomial, data = Contraception, method = "LRT", type = 2, progress=FALSE)) @@ -94,6 +95,7 @@ test_that("print(mixed) works: only 1 or 2 fixed effects with all methods", { expect_that(print(mixed(value ~ treatment+phase+(1|id), data = obk.long)), is_a("data.frame")) expect_that(print(mixed(value ~ treatment+(1|id), data = obk.long, method = "LRT")), is_a("data.frame")) expect_that(print(mixed(value ~ treatment+phase+(1|id), data = obk.long, method = "LRT")), is_a("data.frame")) + skip_if_not_installed("mlmRev") require("mlmRev") # for the data, see ?Contraception expect_that(print(mixed(use ~ urban + (1 | district), method = "PB", family = binomial, data = Contraception, args_test=list(nsim=2))), is_a("data.frame")) expect_that(print(mixed(use ~ urban + livch + (1 | district), method = "PB", family = binomial, data = Contraception, args_test=list(nsim=2))), is_a("data.frame"))