Forest plot with log-transformed model by metafor package in R -
i meta-analysing prevalence of medications rma.glmm command in metafor package. log-transform used follow binomial distribution.
so, model is:
med_a<-rma.glmm(xi=a, ni=sample_size, measure="plo") the forest plot made following code , result attached below.
forest(med_a, atransf = transf.ilogit, ilab = cbind(a, sample_size), ilab.xpos = c(-7,-5), slab = study, refine=1) the scale looks weird 1.00 appears twice , doesn't distribute equal. how change scale , make transformed-back forest plot?
if forest(med_a) here, see default x-axis tick marks drawn @ -6, -4, ..., 6, 8. if use atransf=transf.ilogit, 2 highest values 0.9975274 , 0.9996646 (just try: transf.ilogit(c(6,8))), become 1.00 when rounded 2 decimal places. if forest(med_a, atransf=transf.ilogit, digits=3) see 2 distinct values. not bug in function.
it's bit tricky decent forest plot here (also because of study 3, outlier). 1 thing set tick marks manually. example:
forest(med_a, atransf=transf.ilogit, at=transf.logit(c(.01, .1, .5, .8, .95, .99, .9999))) note cannot use 1 highest value, since inf. after rounding, plot still show 1.00 highest tick mark, bit misleading, since "real" 1 cannot shown on logit scale.
instead of transforming x-axis values, may want transform values themselves. so:
forest(med_a, transf=transf.ilogit, refline=.5) the cis asymmetric, that's correct due using non-linear (back)transformation.

Comments
Post a Comment