Closed itchyshin closed 1 year ago
A few more notes
submerge
only works for mod results - make it work for metafor
objects?
Take out data
arguments?
group
argument needs clarification when people use rma
objects rather than rma.mv
objects
potentially it is good to be able to change the position of k (sample size) or not
The issue is one data set has several effect sizes and some have missing data - things start not to work. For example,
> mat <- submerge(m0, m1, m2,
+ m3, m4,
+ m5, m6, mix = TRUE)
> # renaming
> mat$mod_table$name <- c("DET/SET LBR",
+ "signltons: DET", "signltons: SET",
+ "twins: DET", "twins: SET",
+ "no births: DET", "not births: SET"
+ )
>
> orchard_plot(mat, xlab = "Risk ratio", g = FALSE)
Error in `$<-.data.frame`(`*tmp*`, "g", value = integer(0)) :
replacement has 0 rows, data has 7
If remove ones with missing data, it works
mat0 <- submerge(m0, m1,
m3,
m5, mix = TRUE)
orchard_plot(mat0, xlab = "Risk ratio", g = FALSE)
Actually, this is the issue of not re-naming the moderator column in the data frame - so it can be fixed easily
Seems like it’s a missing data issue. If you use complete.cases() to prevent missing data being dropped during model fitting does this error go away? This should be solved regardless, but maybe not. Now that Wolfgang has added back the data ’slot’ we can just do this data in the functions from now on and it should avoid missing data issues. Anyway, can chat about this in our next meeting
Dan
Thanks @daniel1noble - we will catch up soon. It may be good to use the trim data from the rma.mv/rma object. This may give a general solution for many missing data cases
Yep, completely agree. We initially had it this way but had to pivot when Wolfgang dropped the data from the model object. Shouldn’t be too much work to re-implement. I think all these missing data issues will go away.
@itchyshin Took a while but I've implemented the switch to data being drawn from model object again. Changes to #20 now live on dev branch. All checks passing, but it would be good we try this out with some more examples before merging with main
This issue may be due to the intercept model, not meta-regression models - @daniel1noble - we can probably look at this next time together?
We have the same issue for
mod_results
Gets fixed if you manually trim data