smartdata-analysis-and-statistics / metamisc

This is the official repository of the R package metamisc
https://smartdata-analysis-and-statistics.github.io/metamisc/
GNU Affero General Public License v3.0
6 stars 0 forks source link

Valmeta using Poisson/Log #2

Open NightlordTW opened 2 years ago

NightlordTW commented 2 years ago

Hi Thomas,

I saw you updated the CRAN version of the package recently and it caused some new errors in the JASP implementation. I think that they are related to the "pars" argument in the fitting function (passing model.oe = "poisson/log" now causes the following error:

Error in if (correlation) rr@factors$correlation <- if (!is.na(sigm)) as(rr,  :
  argument is of length zero
In addition: Warning message:
In metamisc::valmeta(measure = options[["measure"]], cstat = if (options[["measure"]] ==  :
  The Sidik-Jonkman-Hartung-Knapp correction cannot be applied

while omitting it works fine. I did not immediately see what changed, any ideas?

Cheers, Frantisek

NightlordTW commented 2 years ago

I'm just gonna attach the full reproducible example if it helps (Files: temp_files.zip)

options <- readRDS(options, "options.RDS")
dataset <- readRDS(dataset, "dataset.RDS")

fit <- metamisc::valmeta(
  measure    = options[["measure"]],
  cstat      = if (options[["measure"]] == "cstat" && options[["inputMeasure"]] != "")              dataset[, options[["inputMeasure"]]],
  [cstat.se](https://eur05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcstat.se%2F&data=05%7C01%7CT.Debray%40umcutrecht.nl%7C00f15e6c309f40fbbd0608dabc2ab030%7Cdcdf4a3dd0c04a6394cf781981249be5%7C0%7C0%7C638029189122307954%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=l1gRy43kcQfi1h7w2Q3f3WMqIwEd66xsNgpDuVusZ5c%3D&reserved=0)   = if (options[["measure"]] == "cstat" && options[["inputSE"]] != "")                   dataset[, options[["inputSE"]]],
  cstat.cilb = if (options[["measure"]] == "cstat" && sum(unlist(options[["inputCI"]]) != "") == 2) dataset[, options[["inputCI"]][[1]][1]],
  cstat.ciub = if (options[["measure"]] == "cstat" && sum(unlist(options[["inputCI"]]) != "") == 2) dataset[, options[["inputCI"]][[1]][2]],
  OE         = if (options[["measure"]] == "OE" && options[["inputMeasure"]] != "")                 dataset[, options[["inputMeasure"]]],
  OE.se      = if (options[["measure"]] == "OE" && options[["inputSE"]] != "")                      dataset[, options[["inputSE"]]],
  OE.cilb    = if (options[["measure"]] == "OE" && sum(unlist(options[["inputCI"]]) != "") == 2)    dataset[, options[["inputCI"]][[1]][1]],
  OE.ciub    = if (options[["measure"]] == "OE" && sum(unlist(options[["inputCI"]]) != "") == 2)    dataset[, options[["inputCI"]][[1]][2]],
  N          = if (options[["inputN"]] != "")      dataset[, options[["inputN"]]],
  O          = if (options[["inputO"]] != "")      dataset[, options[["inputO"]]],
  E          = if (options[["inputE"]] != "")      dataset[, options[["inputE"]]],
  slab       = if (options[["inputLabels"]] != "") dataset[, options[["inputLabels"]]],
  method     = "ML",
  pars       = list(
    model.oe    = if (options[["measure"]] == "OE")    options[["linkOE"]],
    model.cstat = if (options[["measure"]] == "cstat") options[["linkCstat"]]
  )
)