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(\(\beta_i\)) for a predictor and its variance (\(v_i\)), \(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. \(w_i=\frac{1}{v_i} \tag{1}\)

And the overall coefficient will be calculated as:\(\beta=\frac{\sum_{i=1}^{n}w_i\beta_i}{\sum_{i=1}^n w_i}\tag{2}\)

The overall variance is \(V=\frac{1}{\sum_{i=1}^n w_i}\tag{3}\)

The above formulas were for fix effect models, for random effect models we need extra calculations, first we need to calculate \(Q\) statistic

\(Q=\sum_{i=1}^n w_i(\beta_i-\beta)^2\tag{4}\)

Or we can calculate \(Q\) statistic as \(Q=\sum_{i=1}^n w_i\beta_i^2-\frac{(\sum_{i=1}^nw_i\beta_i)^2}{\sum_{i=1}^nw_i}\tag{5}\)

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 \(I^2\)

\(I^2=\begin{cases} &\frac{Q-df}{Q}*100\% \;\;\; \text{ if } Q>df \\ & 0 \;\;\; \text{ if } Q<df \end{cases} \tag{6}\)

where \(df=\text{(number studies)-1}, i.e. n-1\)

For random effect models, we need to calculate the between study variance \(\tau^2\)

\(\tau^2=\begin{cases} &\frac{Q-df}{c} \;\;\; \text{ if } Q>df \\ & 0 \;\;\; \text{ if } Q<df \end{cases} \tag{7}\)

and \(c=\sum_{i=1}^nw_i-\frac{\sum_{i=1}^nw_i^2}{\sum_{i=1}^nw_i}\tag{8}\)

For random effect model, now we need to re-calculate the the variance and weight.

\(v_i^*=v_i+\tau^2\) and \(w^*=\frac{1}{v_i^*}\), therefore, the overall random effect is calculated as

\(\beta^*=\frac{\sum_{i=1}^nw_i^*\beta_i}{\sum_{i=1}^nw_i^*}\tag{9}\)

and the overall variance for the overall random effect is calculated as

\(V^*=\frac{1}{\sum_{i=1}^kw^*}\tag{10}\)

Following the above steps, you can get the exactly same results as the RevMan software for a random effect model meta-analysis.