wwiecek / baggr

R package for Bayesian meta-analysis models, using Stan
GNU General Public License v3.0
46 stars 12 forks source link

binary outcome data without grouping column #121

Open wwiecek opened 2 years ago

wwiecek commented 2 years ago
df <- data.frame(
  n1 = rep(500, 10),
  a = c(rep(28,9), 3),
  n2 = rep(500, 10),
  c = c(rep(30,9), 1)
)
baggr(df)

For Rubin model it's automatically added, but for prepare_ma apparently not

wwiecek commented 2 years ago

Currently, in group_effect.R:43

  # Grab group labels
  if(is.null(attr(bg$inputs, "group_label")))
    par_names <- paste0("Group ", 1:attr(bg$inputs, "n_groups"))
  else
    par_names <- attr(bg$inputs, "group_label")

This should be done inside convert_inputs.R and preferably where I currently say "does not exist in data. No labels will be added"

wwiecek commented 2 years ago

Other fixes in #140 are currently throwing this off. I get different problems depending on whether I go baggr(df, model = "rubin") or baggr(df, model = "logit"). This snippet, convert_inputs:103 to blame:

  if(model == "rubin" && available_data == "pool_binary")
    available_data <- required_data