Metafor Error: Cannot find the object/variable ('yi') specified for the 'yi' argument

Having previously used RevMan software for meta-analysis (which is dialogue box driven), I am now learning how to undertake one in R metafor (using RStudio).

I have run escalc on my data set to generate logRR and variance for the yi and vi variables, which I can see in the console screen.

I then try to fit random-effects model using the rma.uni metfor function, but then get the error code in the title of this message. When I try exists("yi") the response is FALSE (vi is TRUE). Screenshot of the error in RStudio:

I have tried to replicate this using the metadat data set too using the escalc and rma.uni code on Meta-Analysis Package for R • metafor (where everything looks to have worked OK) but get the same error code.

I have also tried running the data and code directly in R (4.2.2) and get the same error there too.

Is there something I am doing/not doing please?

I have looked online but most solutions point to possible typos in the code, or the variable not being labelled/labelled correctly, which it looks like it is in the console panel.

This document shows the expected pattern that you are not following...
escalc returns a result which you must capture and bind to a name with <-

The resulting object is then used as an input to the rma.uni function

Thank you. I now understand.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.