Permalink
Browse files

more robust tests, psych added to suggetss (for tests)

  • Loading branch information...
1 parent ccada51 commit 27d37ad0acb486f5891b680197f8db4f2df5e9a6 singmann committed May 17, 2017
Showing with 4 additions and 1 deletion.
  1. +1 −1 dev.R
  2. +1 −0 tests/testthat/test-mixed-bugs.R
  3. +2 −0 tests/testthat/test-mixed-structure.R
View
2 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",
@@ -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"))
}
@@ -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"))

0 comments on commit 27d37ad

Please sign in to comment.