Skip to content
Prev 4099 / 5632 Next

[R-meta] Adjusted effects p- and z-value

Hi Lena,

See below for my responses.

Best,
Wolfgang
You can use anova() for this. Using the same example from the tutorial:

predict(res, newmods = mean(dat$ablat), transf=exp, digits=2)

anova(res, X = c(1,mean(dat$ablat)))

In contrast to predict() (where the 'intercept' argument controls whether the intercept is included in the linear contrast), with anova() this is done as part of X. Also, there is no 'transf' argument for anova(), but this is not relevant anyway, since the testing is done on the original (in this case, log) scale.
There is actually an addpoly() method for 'predict.rma' objects now. So you can do:

pred <- predict(res, newmods = mean(dat$ablat))
addpoly(pred, addpred=TRUE)

For this to work, don't use transf=exp in predict(). If transf=exp was used as part of the call to forest(), then the addpoly() method will automatically use the same transformation automatically.

dat <- dat.bcg
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat,
              slab=paste0(author, ", ", year))

res <- rma(yi, vi, data=dat)
forest(res, xlim=c(-6.8,3.8), header=TRUE, top=2, atransf=exp, cex=0.9, addpred=TRUE,
       at=log(c(1/16, 1/8, 1/4, 1/2, 1, 2, 4, 8)), digits=c(2L,4L), ylim=c(-2,15))
res <- rma(yi, vi, mods = ~ ablat, data=dat)
pred <- predict(res, newmods = mean(dat$ablat))
addpoly(pred, addpred=TRUE)

I need to update the tutorial to show this.