Note: I do not have very much experience in using R.

I am trying to do a meta-analysis using the metafor package in R. However I have run into an obstacle I haven't been able to surmount myself, which is that I don't know any of the sampling variances for the studies included or how to calculate them from any values that I do know. So for the basic linear meta-analysis function it looks like: rma.uni(yi,vi) I am able to define the vector yi, just the effect sizes, but I don't know how to get the sampling variances for each study that are supposed to comprise vi. I've been trying repeatedly to calculate the sampling variances using escalc (another metafor function) but that has generated only error messages.

The numbers I am trying to meta-analyze are ratios of whole numbers (hypothetical example: 4/7). Both whole numbers are count data, so they are always whole numbers by definition in the original studies from which I obtained them. If anyone asks for more details I'll be glad to provide them.

  • $\begingroup$ Update: I have since realized that it is, I think, possible to calculate the standard error using the formula SE=es/(sqrt(es*n)), where es = effect size and n = sample size. (Source: bmcresnotes.biomedcentral.com/articles/10.1186/1756-0500-5-52) The effect sizes in my case are the case fatality rates for a given suicide method, so the ratio of completed attempts c over completed and nonfatal attempts, c+n: c/(c+n). Obviously both c and n are always whole numbers. $\endgroup$
    – Jinkinson
    May 9, 2020 at 18:45

1 Answer 1


This isn't a metafor or an R problem.

If you don't have the variances, you can't do a meta-analysis. There are many ways to estimate the variances - most commonly you have the means and standard deviations.

If you have count data, you probably want (log) odds ratios or (log) relative risks. How are you calculating the effect sizes?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.