Plus addpoly(), to add a summary polygon to the forest plot that shows
the results from robu(). For example:
library(metafor)
library(robumeta)
set.seed(1002)
dat <- data.frame(vi = runif(20, .01, 1))
dat$yi <- rnorm(20, 0, sqrt(dat$vi + .5))
dat$study <- sort(sample(1:10, 20, replace=TRUE))
res <- robu(yi ~ 1, var.eff.size = vi, studynum = study, data=dat)
res
forest(dat$yi, dat$vi, ylim=c(-1.5,res$M+3), slab=paste("Study",
dat$study), cex=1)
abline(h=0)
addpoly(res$reg_table$b.r, ci.lb=res$reg_table$CI.L,
ci.ub=res$reg_table$CI.U, cex=1)
Best,
Wolfgang
-----Original Message-----
From: R-sig-meta-analysis
[mailto:r-sig-meta-analysis-bounces at r-project.org] On Behalf Of
Michael Dewey
Sent: Saturday, 02 March, 2019 14:18
To: Mufan Luo; r-sig-meta-analysis at r-project.org
Subject: Re: [R-meta] Obtaining study-level effect size and sampling
variance through robust variance models
Dear Mufan
You do not need to fit a model with rma.uni to use forest.
library(metafor)
?forest.default
Michael
On 01/03/2019 18:16, Mufan Luo wrote:
Dear meta-analysists,
Hope this email finds you well.
I am conducting a meta-analysis using robust variance model. To create
forest plot for each study, I?d like to obtain mean effect size and
sampling variance for each study.
I decided to use forest function in metafor to create the forest
plots.
Since the forest function only accepts rma file, I am trying to fit a
rma model (rather than rma.uni) that produces the same coefficient,
95% CI and p-value as the robu model.
For example, below is my robu model,
run.anxiety <- robu(formula = Fisher.s.Z ~ 1,
var.eff.size = Fisher_var,
data = anxiety,
studynum = Study,
modelweights = "CORR")
According to prior discussion about converting robu to rma.uni in this
mail list, I also calculated the number of studies k in cluster j,
average of sampling variance Vbar, and tau square.
tau_sq_robu_anx <- as.numeric(run.anxiety$mod_info$tau.sq)
anxiety$k <- with(anxiety, table(Study)[Study])
anxiety$Vbar <- with(anxiety, tapply(Fisher_var, Study, mean)[Study])
I am trying to get the weight and plug it into the following model,
rma(yi = weightedES, vi = ??, data = weighted)
However, I am not sure if the correct calculation is
anxiety$Vnew <- with(anxiety, as.numeric(Vbar + tau_sq_robu_anx)
Thank you so much for our attention.
Best,
Mufan