1

When I try to perform a meta-analysis with hierarchical weights in robumeta I get

Error in eigen(x) : infinite or missing values in 'x',

using the same data that does not produce any errors with correlational weights. My data matrix does not have any NA or missing values. Cluster entails whole numbers between 1 and 4.

Does anyone know why I get the Eigen(x) error? Code needed to reproduce error:

#load data, you need to adjust read.table depending on where the file is saved.
mydata <- read.table ("H:/Desktop/Max_R_Dataset_Meta_Analysis.csv", header = TRUE, sep = ",")

#install & load packages
library (robumeta)
library (devtools)
install_github("jepusto/clubSandwich")
library (clubSandwich)

#fit moderator model with CORR
res_2 <- robu (formula = effect_size ~ pathway, var.eff.size = effect_size_variance, studynum = Study_ID, modelweights = "CORR", rho = 0.8, small = TRUE, data = mydata)
print (res_2)

#fit moderator model with HIER
hier1 <- robu (formula = effect_size ~ pathway, var.eff.size = effect_size_variance, studynum = cluster, modelweights = "HIER", small = TRUE, data = mydata)
print (hier1)

dput (head(mydata,35))
structure(list(Study_ID = c(1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 
4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L, 2L, 
2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L), effect_size = c(-0.05, 
-0.09, -4.44, 0.28, 0.25, 0.91, 0.31, 0.31, 0.33, 0.27, 0.13, 
0.71, -0.1, -0.09, -0.28, 0.2, 0.23, 1.23, 0.21, 0.22, 0.29, 
-0.18, -0.16, -0.75, 0.2, 0.24, 2.47, 0.37, 0.36, 2.34, 0.17, 
0.15, 0.85, 0.04, 0), effect_size_variance = c(0.010737802, 0.008056791, 
30.135452, 0.010478163, 0.011260784, 0.093962475, 0.006933061, 
0.008891908, 0.007840352, 0.006092875, 0.007411207, 0.040583305, 
0.021610499, 0.019590468, 0.104406625, 0.012783255, 0.011467534, 
0.333023923, 0.004151044, 0.008464275, 0.006936499, 0.012797742, 
0.007904113, 0.307592997, 0.001625522, 0.002084078, 0.230050467, 
0.009038613, 0.00895868, 0.34524772, 0.004019923, 0.002854116, 
0.078314231, 0.007680706, 0), pathway = c(2L, 4L, 6L, 2L, 4L, 
6L, 2L, 4L, 6L, 2L, 4L, 6L, 2L, 4L, 6L, 2L, 4L, 6L, 2L, 4L, 6L, 
1L, 3L, 5L, 1L, 3L, 5L, 1L, 3L, 5L, 1L, 3L, 5L, 1L, 3L), cluster = c(1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 
2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
2L, 2L), Study_Name = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 3L, 
3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L, 1L, 1L, 
1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L), .Label = c("Desiree Thesis Arab", 
"Desiree Thesis White", "Gijs Direct Replication", "Gijs Indirect Replication", 
"Irina Africa Black", "Irina Africa White", "Irina Thesis", "Max Thesis", 
"Stein Race", "Yuan Exp1"), class = "factor")), row.names = c(NA, 
35L), class = "data.frame")

The HIER version works with the example data provided by the robumeta authors.

Max
  • 121
  • 1
  • 10
  • Could you add a sample of your data with `dput`? Edit as shown here: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – NelsonGon Jun 28 '19 at 13:11
  • Just do `dput(head(mydata,n))` and post the output to your question. You may choose n as you may find sufficient. – NelsonGon Jun 28 '19 at 13:40
  • Ah thank you! I misunderstood the instructions in the faq. I added the sample data to the question. – Max Jun 28 '19 at 13:54
  • I cannot reproduce your error. Also there is no pathway_ID in the data. For the Hier model, perhaps you wanted pathway? Still works for me. – NelsonGon Jun 29 '19 at 06:39
  • 1
    I changed it to pathway and the error still appears. Means it is in the second half of the data. One d is exactly 0.00000, that might be it. I'll repost the whole data later this afternoon. – Max Jun 29 '19 at 09:45
  • It works for the first 34 rows, but not with row 35 included. Row 35 is d = 0 – Max Jun 29 '19 at 11:25
  • If row 36 has 0s, then it causes infinite values hence the error. Exclude it or add 1 to all values and account for this. – NelsonGon Jun 29 '19 at 11:27
  • Thank you! But why would it only cause the error in the hierarchical model, as opposed to the correlated model? I'll think about what the best thing to do is. – Max Jun 29 '19 at 11:30
  • Would have to go back to the original paper to understand how the models work. I'm frankly not an expert on the same and haven't read the paper. – NelsonGon Jun 29 '19 at 11:32
  • 1
    Ah okay, thank you very much! I'll see if it makes sense to write the authors. A package that is supposed to aggregate effect sizes should be able to handle an effect size of 0. – Max Jun 29 '19 at 11:36
  • Great, you can update whenever you ever solve the issue. – NelsonGon Jun 29 '19 at 11:37

1 Answers1

1

Thanks to NelsonGon I got an answer: My dataset included an effect size of 0 which produces an infinite eigenvalue in the hierarchical model.

That seems to be caused by differences in the calculation of CORR and HIER models:

CORR uses: dframe$weights <- 1 / (dframe$k * dframe$avg.var.eff.size) while HIER uses dframe$weights <- 1 / dframe$var.eff.size. Although both could theoretically produce 0s, you can check it here: github.com/zackfisher/robumeta/blob/master/R/robu.R The eigen values are actually calculated later in the source code, the Inside Matrix part.

Because HIER divides by var.eff.size, a var.eff.size of 0 produces an error.

Max
  • 121
  • 1
  • 10
  • It seems this is the reason: CORR uses: `dframe$weights <- 1 / (dframe$k * dframe$avg.var.eff.size)` while HEIR uses `dframe$weights <- 1 / dframe$var.eff.size`. Although both could theoretically produce 0s, you can check it here: https://github.com/zackfisher/robumeta/blob/master/R/robu.R The eigen values are actually calculated later in the source code, the Inside Matrix part. – NelsonGon Jun 29 '19 at 11:42