Based on the paper by Valentine et al.:
JC Valentine, TD Pigott, and HR Rothstein.
How Many Studies Do You Need? A Primer on Statistical Power for Meta-Analysis
J of Educational and Behavioral Statistics
April 2010 Vol 35, No 2, pp 215-247
The code itself is adapted from a blog post by
Dan Quintana, Researcher at Oslo University in Biological Psychiatry
On the website Towards Data Science, July 2017
https://towardsdatascience.com/how-to-calculate-statistical-power-for-your-meta-analysis-e108ee586ae8
avg_n
is the average number people in each group in each study, so if you have
4 studies, and each study compared 10 cases and 10 controls, then avg_n
= 10.
NOTE: THIS CODE DOES NOT TAKE MULTIPLE HYPOTHESIS TESTING INTO ACCOUNT
IT ASSUMES P< 0.05
For clarity, avg_n is the average number people in each group in each study, so if you have
4 studies, and each study compared 10 cases and 10 controls, then avg_n = 10.