AKing
AKing

Reputation: 13

Addpoly function adds 95%CIs in text despite specifying 90% using the level argument

I've created a forest plot with subgroups based on an object in . We are reporting 90% CI's which appear correctly next to each row of individual effect size estimates when using the function with the level argument.

res <- rma.mv(yi = g, 
              V = V, 
              random = ~ 1 | study / es_id,  
              data = df,
              method = "REML",
              test = "t")
forest(res,
       xlim = c(-16, 6.75),
       at = c(-4, -2, 0, 2, 4),
       alim = c(-4, 7.25),
       ylim = c(-2,18.5),
       ilab = cbind(df$measure, df$norm_delta_mean, df$norm_delta_sd, df$slow_delta_mean, df$slow_delta_sd), 
       ilab.xpos = c(-11, -8.75, -7.5, -5.75, -4.5),
       slab = df$descriptor, order = training_status,
       mlab = summary_labs_str("RE Model for All Studies", res),
       rows = c(2:6, 10:14), header = "Author(s) and Year",
       cex = 0.95,
       addpred = TRUE,
       level = 90)

The issue I'm encountering is that when using to add the overall summary effect with labels to the figure, using the level = 90 argument alters the polygon and associated PIs as expected (i.e., at the 90% level) but does not alter the text (i.e., Estimate + CIs) as these remain at the 95% level.

addpoly(res, row= 9, level = 90, mlab=summary_labs("Subgroup RE Model", res), addpred = TRUE, cex = 0.875, annotate = TRUE)

What am I missing?

Upvotes: 0

Views: 50

Answers (1)

Wolfgang
Wolfgang

Reputation: 3385

It is not clear to me what text are you referring to. Here is a fully reproducible example that works fine:

library(metafor)
dat <- escalc(measure="RR", ai=tpos, bi=tneg, 
                            ci=cpos, di=cneg, 
              data=dat.bcg, slab=paste0(author, ", ", year))
res <- rma(yi, vi, data=dat)
forest(res, header=TRUE, ylim=-2, level=90)
addpoly(res, level=90)

Both the summary polygon drawn by forest() and the one drawn by addpoly() are both based on 90% CIs and the annotations on the right are correct.

Upvotes: 0

Related Questions