Meta-Analysis in R (RStudio) part I
Darko Medin
Data Scientist and a Biostatistician. Developer of ML/AI models. Researcher in the fields of Biology and Clinical Research. Helping companies with Digital products, Artificial intelligence, Machine Learning.
In this tutorial i will be showing how to practically perform a Meta-analysis in R [1] using RStudio[2] and the 'meta' package, one of the most validated packages with 238 pages of documentation [3] and optimal for use in Biomedical and Pharmaceutical industry.
Library 'meta' allows for very quick performance. In fact, Meta-analysis can be performed in just couple of lines of code.
Let me start with the Effect size/Data explanation...
AS it can be seen the effect size of the Studies (presented as numbers from 1-19 as this is a hypothetical dataset) is presented as standardized mean difference (smd on the image) and is accompanied by its standard error. I will use a Generic Inverse Variance model which weights the studies effects according their inverse variance. Measure of this weight is actually calculated using the standard error (ste). Now to the coding part:
After installing and loading the 'meta' library, the metagen() function is used to create the generic inverse variance model. It can be noticed how i used the object oriented programming to be as efficient as possible and stored objects like mg (metagen model) and the fpmg (forest plot of the metagen object) using names as short as possible but still informative enough. Defining TE (treatment effect) and seTE(standard error of the treament effect), sm = "SMD" (setting standardized mean difference as the main effect) is main framework for developing the model. I also set the method.tau="DL", meaning i will use DerSimonian&Laird method for estimating between study heterogeneity [4].
Ok, once the model is defined as mg, i will create the forest plot (fmpg) in a very simple way, fmpg=forest(mg) and voila, the first forest plot.
Before interpreting the the results i can order the studies according to their effect sizes.
This will be done by adding sortvar argument, so the code will be
>fpmg=forest(mg, sorvar=smd)
领英推荐
Now the plot is visually much more interpretable in terms of both individual studies and pooled effect. One thing i would point out is that there are 2 pooled effect by default. Common model is actually a Fixed effects model and the Random effects model is bellow.
Heterogeneity is also presented on the plot and the associated tau squared and the p value (<0.001) are related to heterogeneity test which is positive in this case. Its important to differentiate Heterogeneity p value from the pooled effects p values which could also be accessed and added simply by running summary(mg) or by setting other arguments within the function which will be discussed further in next tutorials.
Next tutorial will be about making subgroup analysis.
By Darko Medin
Clinical Biostatistics, Data Science and AI expert
References :
1.R Core Team (2014). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.
2. RStudio Team (2015). RStudio: Integrated Development for R. RStudio, Inc., Boston, MA URL https://www.rstudio.com/.
3.Balduzzi S, Rücker G, Schwarzer G (2019). “How to perform a meta-analysis with R: a practical tutorial.” Evidence-Based Mental Health, 153–160.
4.DerSimonian R, Laird N. Meta-analysis in clinical trials. Control Clin Trials. 1986 Sep;7(3):177-88. doi: 10.1016/0197-2456(86)90046-2. PMID: 3802833.
Chartered Accountant & Tech Enthusiast | Specialized in Statistics, Meta Analysis & Visualization in R | YouTube Educator on ShinyApp & Machine Learning | Value-Driven Finance Prof | Seeking Business & Data Analytic role
1 年Excellent, very well presented
Data Scientist and a Biostatistician. Developer of ML/AI models. Researcher in the fields of Biology and Clinical Research. Helping companies with Digital products, Artificial intelligence, Machine Learning.
3 年Some of the topics covered is also understanding the forest plot effect size, weighting based on Generic inverse variance and Fixed and Random effects models parts.