Skip to content

Commit

Permalink
A few more tests skipped on CRAN due to minor numerical differences a…
Browse files Browse the repository at this point in the history
…cross platforms. [ci skip]
  • Loading branch information
wviechtb committed Sep 25, 2016
1 parent 3bfefe5 commit e5f8a3e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: metafor
Version: 1.9-9
Date: 2016-09-23
Date: 2016-09-25
Title: Meta-Analysis Package for R
Authors@R: person("Wolfgang", "Viechtbauer", email = "wvb@metafor-project.org", role = c("aut","cre"))
Depends: R (>= 3.2.0), methods, Matrix
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Changes in Version 1.9-9 (2016-09-23)
Changes in Version 1.9-9 (2016-09-25)
=====================================

o started to use git as version control system, GitHub to host the
Expand Down
8 changes: 7 additions & 1 deletion tests/testthat/test_analysis_example_rothman2008.r
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,16 @@ test_that("results are correct for Mantel-Haenszel method.", {
tmp <- c(round(confint(res, transf=exp)$fixed, 2))
expect_equivalent(tmp, c(1.40, 0.84, 2.34))

skip_on_cran()

### conditional MLE of the odds ratio
res <- rma.glmm(ai=ai, bi=bi, ci=ci, di=di, data=dat, measure="OR", model="CM.EL", method="FE")

expect_equivalent(round(coef(res),3), 0.338)
expect_equivalent(round(res$ci.lb,3), -0.271)
expect_equivalent(round(res$ci.ub,3), 0.947)
expect_equivalent(round(res$QE.Wld,2), 0.35) ### rounded a bit more heavily, so 32-bit and 64-bit versions give same result
expect_equivalent(round(res$QEp.Wld,3), 0.556)
expect_equivalent(round(res$QEp.Wld,2), 0.56) ### rounded a bit more heavily, so OS X version gives same result
expect_equivalent(round(res$QE.LRT,3), 0.350)
expect_equivalent(round(res$QEp.LRT,3), 0.554)

Expand Down Expand Up @@ -262,6 +264,8 @@ test_that("results are correct for Mantel-Haenszel method.", {
expect_equivalent(round(res$MH,3), 11.016)
expect_equivalent(round(res$MHp,3), 0.001)

skip_on_cran()

### unconditional MLE of the rate ratio
res <- rma.glmm(x1i=x1i, x2i=x2i, t1i=t1i, t2i=t2i, data=dat, measure="IRR", digits=2, level=90, model="UM.FS", method="FE")

Expand Down Expand Up @@ -353,6 +357,8 @@ test_that("results are correct for Mantel-Haenszel method.", {
tmp <- c(round(confint(res, transf=exp)$fixed, 2))
expect_equivalent(tmp, c(3.78, 1.43, 10.00))

skip_on_cran()

### unconditional MLE of the odds ratio
res <- rma.glmm(ai=ai, bi=bi, ci=ci, di=di, data=dat, measure="OR", digits=2, level=90, model="UM.FS", method="FE")

Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/test_analysis_example_stijnen2010.r
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ test_that("results for the normal-normal model are correct (measure=='PLO')", {

test_that("results for the binomial-normal normal are correct (measure=='PLO')", {

skip_on_cran()

res <- rma.glmm(measure="PLO", xi=ci, ni=n2i, data=dat)

### compare with results on page 3050 (Table II)
Expand Down Expand Up @@ -94,6 +96,8 @@ test_that("results for the conditional logistic model with exact likelihood are

test_that("results for the conditional logistic model with approximate likelihood are correct (measure=='OR')", {

skip_on_cran()

expect_warning(res <- rma.glmm(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, model="CM.AL"))

### compare with results on page 3052 (Table III)
Expand Down Expand Up @@ -144,6 +148,8 @@ test_that("results for the normal-normal model are correct (measure=='IRLN')", {

test_that("results for the Poisson-normal model are correct (measure=='IRLN')", {

skip_on_cran()

res <- rma.glmm(measure="IRLN", xi=x2i, ti=t2i, data=dat)

### compare with results on page 3054 (Table VII)
Expand Down Expand Up @@ -185,6 +191,8 @@ test_that("results for the normal-normal model are correct (measure=='IRR')", {

test_that("results for the Poisson-normal model are correct (measure=='IRR')", {

skip_on_cran()

res <- rma.glmm(measure="IRR", x1i=x1i, t1i=t1i, x2i=x2i, t2i=t2i, data=dat, model="CM.EL")

### compare with results on page 3055 (Table VIII)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ test_that("rma.peto(), rma.mh(), and rma.glmm() handle outcome1 never occurring
expect_warning(res <- rma.mh(measure="RD", ai=ai, bi=bi, ci=ci, di=di))
expect_equivalent(res$b, 0)

skip_on_cran()

expect_error(suppressWarnings(rma.glmm(measure="OR", ai=ai, bi=bi, ci=ci, di=di)))

})
Expand All @@ -38,6 +40,8 @@ test_that("rma.peto(), rma.mh(), and rma.glmm() handle outcome2 never occurring
expect_warning(res <- rma.mh(measure="RD", ai=ai, bi=bi, ci=ci, di=di))
expect_equivalent(res$b, 0)

skip_on_cran()

expect_error(suppressWarnings(rma.glmm(measure="OR", ai=ai, bi=bi, ci=ci, di=di)))

})
2 changes: 2 additions & 0 deletions tests/testthat/test_misc_rma_handling_nas.r
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ context("Checking misc: proper handling of missing values")

test_that("rma.glmm() handles NAs correctly.", {

skip_on_cran()

dat <- data.frame(ni = rep(20, 10),
xi = c(NA, 4, 0, 0, 2, 2, 3, 8, 9, 2),
mod1 = c(0, NA, 0, 0, 0, 0, 0, 1, 1, 1),
Expand Down

0 comments on commit e5f8a3e

Please sign in to comment.