R language Access Menu

Title Text Both  

Meta-analysis

There are a number of packages availabe in R for meta-analyses. These include  metafor, meta, rmeta, gmeta

We can use following simple dataset for examples here. 

Code:

> studydf = read.table(text='
        Name  EC   TC  EA   TA
  First_etal  25  100  38  200
 Second_etal 305 1750 453 4002
  Third_etal 453 2502 754 4503
 Fourth_etal 287 1285 655 3004
  Fifth_etal  57  185  57  275
', header =T)

> studydf
         Name  EC   TC  EA   TA
1  First_etal  25  100  38  200
2 Second_etal 305 1750 453 4002
3  Third_etal 453 2502 754 4503
4 Fourth_etal 287 1285 655 3004
5  Fifth_etal  57  185  57  275

These are data from 5 studies: First_etal, Second_etal, etc. All these have compared the effect of a treatment on occurrence of a particular event with same event occurring in control group. EC and TC are events and total number of subjects in control group, while EA and TA are events and total number of subjects in treatment group.

The package 'meta' can be used for meta-analysis as follows: 

Code:

> library(meta)
> out = metabin(EA, TA, EC, TC, data=studydf, sm='OR')
> out

      OR           95%-CI %W(fixed) %W(random)
1 0.7037 [0.3963; 1.2495]      2.15      10.29
2 0.6047 [0.5166; 0.7079]     29.95      24.79
3 0.9097 [0.8001; 1.0343]     38.59      25.78
4 0.9696 [0.8285; 1.1348]     25.02      24.80
5 0.5872 [0.3831; 0.9000]      4.30      14.34

Number of studies combined: k=5

                         OR           95%-CI       z  p-value
Fixed effect model   0.8151 [0.7513; 0.8842] -4.9196 < 0.0001
Random effects model 0.7639 [0.6060; 0.9631] -2.2785   0.0227

Quantifying heterogeneity:
tau^2 = 0.0499; H = 2.44 [1.62; 3.68]; I^2 = 83.2% [61.8%; 92.6%]

Test of heterogeneity:
     Q d.f.  p-value
 23.81    4 < 0.0001

Details on meta-analytical method:
- Mantel-Haenszel method
- DerSimonian-Laird estimator for tau^2

> meta::forest(out)          

              

The forest plot shows odds ratio and their confidence interval for each study as well as for the pooled data. 

A funnel plot can be obtained with following simple command: 

Code:

    > funnel(out)

Output graph:
                
References:

Guido Schwarzer (2015). meta: General Package for Meta-Analysis. R package version 4.2-0.
http://CRAN.R-project.org/package=meta
 


    Comments & Feedback