You are here

Help deal with an error message: "1:(rsum * csum) : NA/NaN argument"

5 posts / 0 new
Last post
wang2022's picture
Offline
Joined: 11/26/2022 - 22:33
Help deal with an error message: "1:(rsum * csum) : NA/NaN argument"
AttachmentSize
Plain text icon samplesize.txt3.62 KB
Plain text icon cordata1.txt472.73 KB
Plain text icon study counts5.txt598 bytes
Plain text icon Rcode.txt807 bytes

Dear Dr. Cheung and Colleague,

I hope everyone is staying safe and having a wonderful holiday season!

We are currently conducting an metaSEM with a massive dataset: 1008 studies/matrices with 12 variables. Admittedly, there are quite many missing values in the dataset. However, we make sure that each cell has at least 10 data points from the primary studies (see “study counts5” in the attachment).

Because the dataset was too large, it took over 5 hours on my computer with a latest i9 processor to complete the stage1random estimation. Unfortunately, when I checked the output, it gave me nothing but an error message saying that the column and/or raw sum was NA.

We don’t know how to solve the estimation error, as there seemed no errors in the code. We would greatly appreciate it if you or any colleague could kindly advise how to deal with it. I have attached the cordata and sample size files as well as the code.

Thank you very much for your time and help! Happy holidays!

Mike Cheung's picture
Offline
Joined: 10/08/2009 - 22:37
Hi Wei,

Hi Wei,

The problem is related to the data being too sparse, which returns an error in the homogeneity test. The following command should work.

summary1 <- summary.meta(stage1random, homoStat = FALSE)

BTW, you can speed up the analysis by using multicores. It took about half an hour on my computer.

mxOption(key='Number of Threads', value=parallel::detectCores())
wang2022's picture
Offline
Joined: 11/26/2022 - 22:33
Hi Mike,

Hi Mike,

Thank you so much for your prompt response and help! I tried the summary.meta function and it worked very well on my end. Thanks again!

However, the mxOption() function didn't seem to work so well. It did help speed up, yet it still took about 3 hours (vs. 5 hours without using the multicore functionality). I'm wondering if it is any way for us to speed up further. We are considering to rerun the stage1random to get better convergence. BTW, we were using a computer with an Intel 12th (the latest) i9 processor. It would be great if the computer can ran one cycle within 30 minutes.

Thanks for your time!

Mike Cheung's picture
Offline
Joined: 10/08/2009 - 22:37
Apart from using the

Apart from using the multicore function, another way is to try the Microsoft R (https://mran.microsoft.com/open). Some users have reported that it speeds up the analysis.

wang2022's picture
Offline
Joined: 11/26/2022 - 22:33
Thank you very much for the

Thank you very much for the information, Mike! We will try it out and hope it will be more efficient.