# [R-meta] Ratio of Means

Viechtbauer Wolfgang (SP) wolfgang.viechtbauer at maastrichtuniversity.nl
Fri Jul 28 14:11:54 CEST 2017

```Please keep r-sig-meta-analysis at r-project.org in cc.

Yes, the same formula hold regardless of the outcome measure.

The row/column names of the G matrix tell you what levels they refer to. In the example:

> res\$G
CON      EXP
CON 2.407333 1.757327
EXP 1.757327 1.431371

So, the variance in the log odds ratios (amount of heterogeneity) is:

> tau2 <- res\$G[1,1] + res\$G[2,2] - 2* res\$G[1,2]
> tau2
[1] 0.3240504

The conditional variance in the log odds in the treatment (EXP) groups (and also of the log odds ratios) is:

> tau2.cond <- res\$G[2,2] - res\$G[1,2]^2 / res\$G[1,1]
> tau2.cond
[1] 0.1485416

So, baseline risk explains:

> (tau2 - tau2.cond) / tau2
[1] 0.5416095

that is, 54% of the heterogeneity.

Best,
Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com

-----Original Message-----
From: Nathan Pace [mailto:n.l.pace at utah.edu]
Sent: Thursday, July 27, 2017 20:45
To: Viechtbauer Wolfgang (SP)
Subject: Re: [R-meta] Ratio of Means

Hi,

I ended up using ggplot2 (see attached).

The slope is essentially 1 (0.9732  +/- 0.0407).

In van Houwelingen, page 605, there is an estimation of the per cent variance of the vaccination effect explained by the true log-odds of the not-vaccinated group.

I assume these formulas also would hold for the response ratio

The G matrix is used to calculate this. It appears that the G matrix is rotated on the minor axis compared to that reported by van Houwelingen. Correct?

If I assume that G matrix is not rotated, then I would use

var.mu <- G[1, 1] + G[2, 2] - 2 * G[1, 2]

cond.var.mu <- G[1, 1] - (G[1, 2]^2/G[2, 2])

explained.var.mu <- (var.mu - cond.var.mu)/var.mu

If I assume that G matrix is rotated, then I would use

var.mu <- G[1, 1] + G[2, 2] - 2 * G[1, 2]

cond.var.mu <- G[2, 2] - (G[1, 2]^2/G[1, 1])

explained.var.mu <- (var.mu - cond.var.mu)/var.mu

The G matrix for my data is

Exp      Ctl
Exp 1.245291 1.234160
Ctl 1.234160 1.268151

This gives an explained variance of either 0.02 (G matrix rotated) or 0.002 (G matrix not rotated).