Why do I keep getting NaN errors when I try to run the code for the metasens package in R?

I'm trying to run what I though was relatively straightforward code for a meta-analysis publication bias model using the metasens package for R on a data frame, using the following code:

library(meta)
library(metasens)

CopasPBData <- data.frame(
  es = c(0.1267, -0.012, 0.0216, 0.0876, 0.1619, 142.2493, -0.0091, 95.7105, 0.1411, 0.0998, 88.4837, 0.008, 0.1772, 0.009, -0.0748, 0.06, 0.5981, -0.1118, -863.47, 0.121, 0.028),
  se = c(0.0425, 0.0159, 0.0094, 0.0018, 0.0264, 61.0296, 0.0168, 6.4822, 0.0027, 0.0368, 9.2297, 0.0076, 0.027, 0.0364, 0.0204, 0.05, 0.0656, 0.056, 1824.75, 0.1443, 0.0144))

CopasPBMA <- metagen(es, se, data = CopasPBData, sm = "SMD", comb.random = gs("comb.random"))
summary(CopasPBMA)

CopasPBModel <- copas(CopasPBMA, rho.bound = 0.9999)
plot(CopasPBMA, 1:4)
summary(CopasPBMA)

warnings(CopasPBModel)
warnings()

What I expected to get was a couple of model estimates, followed by a series of beautiful plots demonstrating how the the estimated main effect changes as a function of the changing probability of the suppression of the smallest/least precise effect size in the data. What I got instead was a series of error messages:

Warning messages:
1: In sqrt(1 - rho2.tilde) : NaNs produced Error in cat("1: In sqrt(1 - rho2.tilde) : NaNs produced", list(TE = c(0.1267,  : 
  argument 2 (type 'list') cannot be handled by 'cat'
> warnings()
Warning messages:
1: In sqrt(1 - rho2.tilde) : NaNs produced
2: In sqrt((s2t2) * (1 - rho2.tilde)) : NaNs produced
3: In sqrt((1 - rho2.tilde)) : NaNs produced
4: In sqrt(1 - rho2.tilde) : NaNs produced
5: In sqrt((s2t2) * (1 - rho2.tilde)) : NaNs produced
6: In sqrt((1 - rho2.tilde)) : NaNs produced
7: In sqrt(1 - rho2.tilde) : NaNs produced
8: In sqrt((s2t2) * (1 - rho2.tilde)) : NaNs produced
9: In sqrt((1 - rho2.tilde)) : NaNs produced
10: In sqrt(1 - rho2.tilde) : NaNs produced
11: In sqrt((s2t2) * (1 - rho2.tilde)) : NaNs produced
12: In sqrt((1 - rho2.tilde)) : NaNs produced
13: In sqrt(1 - rho2.tilde) : NaNs produced
14: In sqrt((s2t2) * (1 - rho2.tilde)) : NaNs produced
15: In sqrt((1 - rho2.tilde)) : NaNs produced
16: In sqrt(1 - rho2.tilde) : NaNs produced
17: In sqrt((s2t2) * (1 - rho2.tilde)) : NaNs produced
18: In sqrt((1 - rho2.tilde)) : NaNs produced

Near as I can figure, the package is using an equation in which, for 18 out of the 21 data points, the denominator evaluates to 0. I have no idea why that's happening, however. Any insight/advice would be greatly appreciated.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.