Skip to content
Prev 2857 / 5632 Next

[R-meta] metafor::escalc question: Confidence intervals for differences in standardized mean change -

Hi Wolfgang -

Thanks for your reply.  Unfortunately, when I attempt to create the
escalc object from the 'dat' dataframe, I get the error message below.

"> new_dat <- escalc(data=dat, yi=yi, vi=vi)
Error in escalc(data = dat, yi = yi, vi = vi) :
  Must specify an effect size or outcome measure via the 'measure' argument."

If I add measure = "GEN" the following error results:

"> new_dat <- escalc(measure = "GEN", data=dat, yi=yi, vi=vi)
Error in attributes(dat[[var.names[1]]])$ni[include & yi.replace] <-
ni.u[include &  :
  replacement has length zero"

Appears I'm still missing some nuance.

Best

--Dale

datT <- data.frame(
  m_pre   = c(30.6, 23.5, 0.5, 53.4, 35.6),
  m_post  = c(38.5, 26.8, 0.7, 75.9, 36.0),
  sd_pre  = c(15.0, 3.1, 0.1, 14.5, 4.7),
  sd_post = c(11.6, 4.1, 0.1, 4.4, 4.6),
  ni      = c(20, 50, 9, 10, 14),
  ri      = c(0.47, 0.64, 0.77, 0.89, 0.44))

datC <- data.frame(
  m_pre   = c(23.1, 24.9, 0.6, 55.7, 34.8),
  m_post  = c(19.7, 25.3, 0.6, 60.7, 33.4),
  sd_pre  = c(13.8, 4.1, 0.2, 17.3, 3.1),
  sd_post = c(14.8, 3.3, 0.2, 17.9, 6.9),
  ni      = c(20, 42, 9, 11, 14),
  ri      = c(0.47, 0.64, 0.77, 0.89, 0.44))

datT <- escalc(measure="SMCR", m1i=m_post, m2i=m_pre, sd1i=sd_pre,
               ni=ni, ri=ri, data=datT)
datC <- escalc(measure="SMCR", m1i=m_post, m2i=m_pre, sd1i=sd_pre,
               ni=ni, ri=ri, data=datC)

dat <- data.frame(yi = datT$yi - datC$yi, vi = datT$vi + datC$vi)
dat

new_dat <- escalc(data=dat, yi=yi, vi=vi)
summary(new_dat)

On Mon, May 17, 2021 at 6:19 AM Viechtbauer, Wolfgang (SP)
<wolfgang.viechtbauer at maastrichtuniversity.nl> wrote: