Meta-Analysis in R part 2. Adding Fixed, Random effect tests and Prediction intervals using 'meta' library
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 previous article an example of using R[1] (and RStudio [2]) 'meta' [3] package and its function metagen() were discussed and used to create a Meta-analysis model and forest plot. In this tutorial i will show how to use the same library and add Fixed effects and Random effects hypothesis test estimates and the Prediction interval.
These estimates are needed for complete interpretation of the results and better understanding of the Meta-analysis model. I will start with the code to create the model.
This time i will use the forest function in a specific way:
fpmg=forest(mg, sortvar=smd,test.overall.fixed=TRUE, addrows = 3).
Notice how i added overall.fixed=TRUE, this will add the test results for a Fixed effects model. Since there will be a lot of text on the plot, some of it might overlap, so ill add addrows = 3, which will add space between text lines and avoid the overlaps.
Here is the resulting plot:
It can be seen that the Test for overall effect (fixed effect) is now added, with a z value of 8.15 and a corresponding p value <0.01. Previously, i discussed the heterogeneity test, which is positive here with tau^2 of 0.46 and 58% heterogeneity.
But as the plot contains the Random effects model, so i will add the test for the Random effects too:
#By adding the random effect test the tests are now complete
#Heterogeneity test , fixed effect test e and the random effects
#are added to the plot
>fpmg=forest(mg, sortvar=smd,test.overall.fixed=TRUE,
>????? test.overall.random=TRUE, addrows = 3)
Here is the result:
Now i added all the segments of the test i initially wanted, which are, Heterogeneity test, Fixed effect overall test and Random effects overall test (which has a bit smaller z value and a significant overall result which was expected).
The next thing ill add is the prediction interval. Note that i previously plotted the confidence intervals for individual studies and their central estimates as SMDs or standardized mean differences. I also plotted the confidence intervals for overall Fixed and Random effects models.
领英推荐
As this is the 95% confidence interval it shows and interval where i can expect that the estimate (pooled SMD) will be with 95% probability. But that's just the central estimate. Its important to know in which interval can individual studies can be expected not just the pooled estimate. I will achieve this by adding the Prediction interval (95%), just by typing prediction=TRUE as an argument in the forest() function.
Here is the final code:
Now the forest() function arguments are complete and here is the resulting final plot:
The prediction interval is present now along with Fixed effects and Random effects confidence intervals and is ready for interpretation.
Thanks for reading and in the next part i will be talking about changing the appearance of the plot to match different journal standards using R 'meta' package .
References:
1.https://www.r-project.org/
2.https://www.rstudio.com/
3.https://cran.r-project.org/web/packages/meta/meta.pdf
Advisor Clinical Data Scientist @ Abbott | PhD, MedTech, Digital Health
1 年Very nice and straightforward explanation. Can you re-order the summary of the fixed and random effect such that the random effect model comes first before the fixed effect model? Most primary analysis is with random effects and would be nice to have the results first before the fixed effect model. Thanks
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 年This time the focus on hypothesis tests placement and adding the prediction interval especially important in Clinical trial evidence synthesis