guido-s / meta

Official Git repository of R package meta
http://cran.r-project.org/web/packages/meta/index.html
GNU General Public License v2.0
81 stars 31 forks source link

Three-level model using `metagen` doesn't calculate individual study weights #37

Closed igelstorm closed 3 years ago

igelstorm commented 3 years ago

Some colleagues and I are using meta for a three-level meta-analysis and have encountered into some behaviour that we don't quite understand. I'm hoping this might be an appropriate forum to ask, but apologies if not!

After creating a three-level model using metagen (i.e. passing in an id vector that has the same value for some studies), weights(model) returns NA for every study, and the model$w.fixed and model$w.random attributes are both NA. As a consequence, it's not possible to include weights e.g. in a forest plot.

Based on this line in the metagen code I'm guessing this is intentional behaviour, but it doesn't seem to be documented anywhere. Is it just not possible to calculate individual study weights for a three-level model, or is there some way around this? I noticed that rma.mv is used under the hood, and there seems to be a way to retrieve weights from a rma.mv object, but I don't really know enough about the details to tell whether this could be used here.

Happy to provide a reprex or a clearer description if it's helpful, but I figured there might be a simple reason this decision was made, so I thought I would just ask first.

Thanks for a very usable and powerful package! ⭐

guido-s commented 3 years ago

Erik,

Thank you for your post. I never thought about using weights.rma.mv() for three-level models. I am now using the rowrum weights which seem to be most appropriate for a three-level model.

Best, Guido

igelstorm commented 3 years ago

Many thanks for the fast response and fix! We've tried with the latest version, and the weights we get look plausible.