The calculations for random effect model meta-analysis are quite straight forward, the followings are steps we need to conduct a random effect model meta analysis using inverse variance weight method.
Random effect meta analysis calculations:
Suppose we got the coefficient(βi) for a predictor and its variance (vi), i=1,2,...n, from each cohort and n is number of cohorts we have.
We assign the weight as inverse of the variance i.e. wi=1vi
And the overall coefficient will be calculated as:β=∑ni=1wiβi∑ni=1wi
The overall variance is V=1∑ni=1wi
The above formulas were for fix effect models, for random effect models we need extra calculations, first we need to calculate Q statistic
Q=∑ni=1wi(βi−β)2
Or we can calculate Q statistic as Q=∑ni=1wiβ2i−(∑ni=1wiβi)2∑ni=1wi
Note formula (4) and (5) are exactly the same, which one you use depending on how you think it is easier to program.
Aftere we get Q statistic we can calculate the I2
I2={Q−dfQ∗100% if Q>df0 if Q<df
where df=(number studies)-1,i.e.n−1
For random effect models, we need to calculate the between study variance τ2
τ2={Q−dfc if Q>df0 if Q<df
and c=∑ni=1wi−∑ni=1w2i∑ni=1wi
For random effect model, now we need to re-calculate the the variance and weight.
v∗i=vi+τ2 and w∗=1v∗i, therefore, the overall random effect is calculated as
β∗=∑ni=1w∗iβi∑ni=1w∗i
and the overall variance for the overall random effect is calculated as
V∗=1∑ki=1w∗
Following the above steps, you can get the exactly same results as the RevMan software for a random effect model meta-analysis.