tests/testthat/test-pema_runs.R

df <- eval(parse(text = 'structure(list(yi = c(1.01, 0.82, 0.59, 0.44, 0.84, 0.73, 1.12,
0.04, 0.24, 0.32, 1.04, 1.31, 0.59, 0.66, 0.62, 0.47, 1.08, 0.98,
0.26, 0.39, 0.6, 0.94, 0.11), vi = c(0.2704, 0.2116, 0.0529,
0.0324, 0.0841, 0.0841, 0.1296, 0.1369, 0.0225, 0.16, 0.1024,
0.3249, 0.0841, 0.0361, 0.0961, 0.0729, 0.1024, 0.1024, 0.0324,
0.0324, 0.0961, 0.2809, 0.0729), year = c(1992L, 2000L, 2000L,
2004L, 2005L, 2008L, 2008L, 2010L, 1992L, 1998L, 2006L, 2008L,
1992L, 2002L, 1995L, 1998L, 1998L, 2001L, 2002L, 2003L, 2004L,
2008L, 2008L), score = c(6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 7L,
7L, 7L, 7L, 18L, 8L, 9L, 9L, 9L, 9L, 9L, 9L, 10L, 10L, 12L),
    fumonths = c(19L, 18L, 24L, 21L, 24L, 6L, 18L, 26L, 3L, 12L,
    12L, 9L, 12L, 21L, 12L, 18L, 22L, 18L, 21L, 21L, 30L, 6L,
    13L), retention = c(83, 100, 90.1649966666667, 57, 100, 87,
    89, 86, 79, 100, 92, 100, 96, 100, 93.3, 94, 100, 98, 95,
    95, 100, 100, 100), outcomes = c(2L, 4L, 35L, 16L, 3L, 26L,
    4L, 11L, 2L, 1L, 7L, 1L, 16L, 10L, 4L, 5L, 10L, 13L, 7L,
    12L, 4L, 6L, 53L), duration = c(18L, 12L, 12L, 21L, 24L,
    12L, 18L, 26L, 2L, 12L, 5L, 9L, 21L, 3L, 12L, 12L, 22L, 18L,
    21L, 21L, 24L, 6L, 12L), meetings = c(30, 5, 4, 15, 4, 12,
    3, 4.5, 2, 3, 5, 18, 15, 3, 1, 10, 4, 33, 15, 15, 9, 18,
    9), hours = c(1, 1, 1.5, 1, 1, 1.5, 6, 6, 0.25, 1, 1, 6,
    1, 1, 15, 0.75, 3, 1.75, 1, 1, 1, 4, 0.75)), row.names = c(NA,
-23L), class = "data.frame")
'))

res <- tryCatch({
  suppressWarnings(brma(yi ~. , df, iter = 10))
  }, error = function(e){NULL})
test_that("pema runs", {
  expect_true(!is.null(res))
})

Try the pema package in your browser

Any scripts or data that you put into this service are public.

pema documentation built on March 31, 2023, 11:38 p.m.