Closed jessistanbul closed 1 year ago
Please post a fully reproducible example that generates the error.
Hey,
How can I 'upload' the dataset here to run the codes and get the error?
You can't. Use dput()
. See the links that are provided in the issue template.
Hi!
I just edited my question by virtually putting the dataset up by using the dput() function. I was able to reproduce the error. Could you please take a look? Thanks!
Thanks - much better! Took me a while to track down where this bug is coming from. Without going into the details, if you rename your x
variable, then it will work. So just run names(macro.ovwt)[which(names(macro.ovwt) == "x")] <- "xvar"
first. A bit difficult to explain why this is needed for now, but I can fix this bug in the next / development version of the package. Thanks for reporting this because it made me realize something I had not considered before.
Hi. Thanks for your response! I just tried, and it worked!
I really, really appreciate your timely help. Your package is really helpful.
Classification: Bug Report
(Pick one of: Bug Report, Feature Request, Enhancement Suggestion)
General questions about the use of the metafor package should not be asked here, but on the
r-sig-meta-analysis
mailing list (https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis). Anything posted here should really be related to the development of the package (including potential bug reports).Summary
Dear developer,
I ran into the following error from R when using conv.wald() function.
I am trying to do a meta-analysis using the metafor package. I have 14 studies to be pooled together, out of which 10 studies came in 2*2 table format. So I used escalc() function to generate yi and vi. This step worked out fine, with the following codes:
macro.ovwt.m<-escalc(measure='OR',ai=t1d1,bi=t1d0,ci=t0d1,di=t0d0,data =macro.ovwt)
For the remaining 4 studies (currently missing yi and vi in the table), the data came in OR and 95% CI. So I wanted to use conv.wald() to convert those ORs and 95% CIs and get yi and vi to make the table complete. I wrote the following codes with reference from this website (https://wviechtb.github.io/metafor/reference/conv.wald.html) - and this is where I ran into the problem.
macro.ovwt.m<-conv.wald(out=oddsratio, ci.lb=lower, ci.ub=upper, data=macro.ovwt.m,transf=log) Error: Cannot find the object/variable ('x[[yi.name]]') specified for the 'yi' argument.
I tried to write codes following the codes from the same website (https://wviechtb.github.io/metafor/reference/conv.wald.html) to manually generate a data frame, with just those 4 studies corresponding to four rows. By doing this, I was able to manually calculate yi and vi. Output was given below.
dat<-data.frame(study=1:4, oddsratio=c(2.06,1.16,0.93,1.54),lower=c(1.50,0.75,0.21,0.74),upper=c(2.84,1.82,4.12,3.17) )
dat <- conv.wald(out=oddsratio, ci.lb=lower, ci.ub=upper, data=dat, transf=log) dat
Yes - I understand that I could output the previous table (with yi and vi missing for the four studies) as a csv. file and then manually fill in the table, but I realize this is not ideal and can be manually prone to errors and burdensome as the number of studies gets more.
Could you please help me to see why I got the error message when running the conv.wald() function? My next step would be to use res.macro.ovwt<-rma(yi,vi,data=macro.ovwt.m,method='DL') for the meta-analysis and then to generate forest plot.
Thank you so much for your help!! Really appreciate it. :)
-Jessie
Reproducible Example (if applicable)
If applicable, please provide a minimal and fully reproducible example. Remove any superfluous code that is not pertinent to the issue at hand and provide a small dataset together with the code so that it can actually be run (the
dput()
function is extremely useful for this; or use one of the datasets that comes with the metafor package). See also: