Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plotting two sets of data points on funnel plot (metafor for R)

Tags:

r

I am performing a meta-analysis of epidemiological data where studies can be segregated into two groups (e.g. by methodology). Is there any way to alter the points plotted on the funnel plot to identify the groups (e.g. dots and crosses)?
(Much as the pch.fill does when trimfill is used) Thanks.

like image 834
Cullen Avatar asked Oct 22 '22 14:10

Cullen


1 Answers

For each study, there should be an indicator showing if it's method A of method B, right? Suppose the variable is called StudyType (= 16 if method A, = 17 if method B), you can then plot them with different symbol by specifying "pch=StudyType." The plot will use pch=16 for TypeA, and pch=17 for TypeB.

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

### Attach study type (I just randomly made up some here):
StudyType = sample(c(16,17),13,replace=T)

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

### standard funnel plot (Notice the pcd command)
funnel(res, pch=StudyType)

enter image description here

like image 52
Penguin_Knight Avatar answered Oct 24 '22 02:10

Penguin_Knight