Skip to content
Prev 1678 / 5636 Next

[R-meta] Do the results of rma.mv() depend on how dataframe rows are ordered/arranged?

Gabriele,

The problem is that the variance matrix gets re-ordered when you do split()
%>% lapply() %>% bldiag(). Try running the following to see the issue:

# data frame, not sorted by ID
dat <- data.frame(ID = rep(LETTERS[1:3], 4), v = 1:12)
split(dat$v, dat$ID)
bldiag(lapply(split(dat$v, dat$ID), diag, nrow = 4))

To use the split() %>% lapply() %>% bldiag() technique and have the matrix
come out so that the entries of the V matrix correspond to the rows of the
data, the data needs to be sorted by the same ID variable that is used in
split().

James

On Thu, Aug 22, 2019 at 7:30 AM Gabriele Midolo <gabriele.midolo at gmail.com>
wrote: