Skip to content
Prev 2030 / 5632 Next

[R-meta] R-sig-meta-analysis Digest, Vol 35, Issue 7

Hi Michael,


Sorry. I copied the wrong link. I am using data from this link. Attaching the data as a csv as well. Below is the code and output. http://www.metafor-project.org/doku.php/tips:rma.uni_vs_rma.mv


Perhaps just to be clear - I am trying to bootstrap errors in estimation which uses rma.mv and moderator variables.


##Code
dat <- read_csv("test.csv")
#RE
rma(yi, vi, data=dat)
#CRVE
rma.mv(yi, vi, random = ~ 1 | trial, data=dat)
#Bootstrapping
res <-rma.mv(yi, vi, random = ~ 1 | trial, data=dat, mods = ~ alloc)

boot.func <- function(df, indices) {
  sub <- dat[indices,]
  res <-rma.mv(yi, vi, random = ~ 1 | trial, data=dat, mods = ~ alloc)
  if (is.element("try-error", class(res))) NA else c(coef(res), vcov(res))
}


## Output
Bootstrap Statistics :
        original  bias    std. error
t1*  -0.51792376       0           0
t2*  -0.44786464       0           0
t3*   0.08899601       0           0
t4*   0.19465035       0           0
t5*  -0.19465035       0           0
t6*  -0.19465035       0           0
t7*  -0.19465035       0           0
t8*   0.26607085       0           0
t9*   0.19465035       0           0
t10* -0.19465035       0           0
t11*  0.19465035       0           0
t12*  0.31363498       0           0



Error in sort.int(x, na.last = na.last, decreasing = decreasing, ...) :
  index 0 outside bounds
In addition: Warning messages:
1: In sqrt(tv[, 2L]) : NaNs produced
2: In norm.inter(z, (1 + c(conf, -conf))/2) :
  extreme order statistics used as endpoints




Tarun Khanna

PhD Researcher

Hertie School


Friedrichstra?e 180

10117 Berlin ? Germany
khanna at hertie-school.org ? www.hertie-school.org<http://www.hertie-school.org/>