Skip to content

Trim and fill procedure

3 messages · Carlijn Wibbelink, Michael Dewey, Viechtbauer Wolfgang (STAT)

#
Hi all,

I have a question concerning the trim and fill procedure in metafor. In STATA it is possible to obtain the values of the added estimated effect sizes. I was wondering if this is also possible in R and if so, how I can obtain the new data with the added values. 
I would really appreciate your response.
1 day later
#
Hello Carlijn

Well the documentation for trimfill says they are added.

library(metafor)
example(trimfill)

This now leaves you with
res
res.tf

By looking at these and seeing which vectors have grown you should be 
able to extract the yi and vi which you want.

Wolfgang will doubtless be on the list soon to tell us there is a neater 
way of doing this.
On 04/04/2015 21:27, Carlijn Wibbelink wrote:

  
    
  
#
Yes, a comparison of the two objects would tell you what's been added.

An object returned by the trimfill() function also has a vector added to it, named 'fill', which indicates whether the data (which are stored in the vector 'yi') are observed or augmented values. So, for example:

library(metafor)

### load BCG vaccine data
data(dat.bcg)

### meta-analysis of the log relative risks using a fixed-effects model
res <- rma(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, method="FE")

### trim and fill analysis
tmp <- trimfill(res)

### show log relative risks and dummy variable to indicate augmented values
data.frame(tmp$yi, tmp$fill)

### that's in fact how the funnel() function knows how to draw the points when you do:
funnel(tmp)

Best,
Wolfgang