Hi Mike and all,
I'm a new learner of meta-analysis and just try to use metaSEM.
My dataset comprises 90 sets of 19*19 correlation matrix and every one contains some missing values. I'm trying to estimate a TSSEM model but encounter a problem in the first stage.
After loading all the 90 matrices, I use "is.pd" to check if they are positive definite, and the results are all "TRUE". When I use "tssem1(my.R, n, method="FEM"), it returns an error message saying that "Error in eigen(if (doDykstra) R else Y, symmetric = TRUE) : infinite or missing values in 'x'". Then I try to apply a random effect model by "tssem1(my.R, n, method="REM", RE.type="Diag", acov="weighted")", but no result has come out.
Is it due to the missing value, or any other issues that I have mistakenly ignored? how should I do to resolve the problem? Sincerely appreciate if you could help, thanks!
Best regards,
Eleanor
Hi Eleanor,
Could you please provide the data and R code so that I can check it?
Best,
Mike
Hi Mike,
Here are the R code and data FYI., thank you!
Cheers,
Eleanor
Dear Eleanor,
There in no data in many of the correlation coefficients. It is normal that the program does not work.
Regards,
Mike
> pattern.na(My.R,show.na=FALSE)
x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19
x1 49 35 0 32 9 18 9 23 3 1 22 12 9 2 3 4 2 2 12
x2 35 38 0 24 5 11 6 19 3 1 15 7 6 1 4 3 3 2 6
x3 0 0 12 2 1 0 0 1 0 7 1 0 1 4 1 0 0 0 2
x4 32 24 2 41 3 14 6 18 1 0 17 8 8 2 3 4 1 1 8
x5 9 5 1 3 11 4 4 5 1 0 7 3 6 0 1 0 1 0 3
x6 18 11 0 14 4 18 5 10 0 0 10 6 3 0 0 2 0 0 3
x7 9 6 0 6 4 5 10 5 2 0 4 5 5 1 0 0 0 0 1
x8 23 19 1 18 5 10 5 27 0 0 16 4 6 1 3 4 2 1 8
x9 3 3 0 1 1 0 2 0 4 0 0 2 2 0 2 0 2 2 0
x10 1 1 7 0 0 0 0 0 0 8 0 0 0 1 0 0 0 0 1
x11 22 15 1 17 7 10 4 16 0 0 27 2 7 0 2 1 1 0 9
x12 12 7 0 8 3 6 5 4 2 0 2 14 6 0 0 1 0 0 2
x13 9 6 1 8 6 3 5 6 2 0 7 6 13 0 0 1 0 0 5
x14 2 1 4 2 0 0 1 1 0 1 0 0 0 6 1 0 0 0 0
x15 3 4 1 3 1 0 0 3 2 0 2 0 0 1 11 0 4 3 1
x16 4 3 0 4 0 2 0 4 0 0 1 1 1 0 0 7 0 0 0
x17 2 3 0 1 1 0 0 2 2 0 1 0 0 0 4 0 4 3 0
x18 2 2 0 1 0 0 0 1 2 0 0 0 0 0 3 0 3 3 0
x19 12 6 2 8 3 3 1 8 0 1 9 2 5 0 1 0 0 0 20
Dear Mike,
Thanks for pointing out the problem.
Following your comments, I consolidated my data into 64 matrices with 10 variables to eliminate missing data. When running "pattern.na(My.R,show.na=FALSE)", the result is as follows:
> pattern.na(My.R,show.na=FALSE)
x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
x1 46 33 31 9 17 9 23 21 12 9
x2 33 36 23 5 10 6 19 14 7 6
x3 31 23 40 3 13 6 18 16 8 8
x4 9 5 3 11 4 4 5 7 3 6
x5 17 10 13 4 17 5 10 9 6 3
x6 9 6 6 4 5 10 5 4 5 5
x7 23 19 18 5 10 5 27 16 4 6
x8 21 14 16 7 9 4 16 26 2 7
x9 12 7 8 3 6 5 4 2 14 6
x10 9 6 8 6 3 5 6 7 6 13
Then I tried to fit my data into FEM and REM respectively, but still not results have popped out. The error notice I've got are "Error in cov2cor(sampleS) : 'V' is not a square numeric matrix", and "Error: Argument 'backtransf' must be a logical."
Thank you very much if you could help to check again and advise what issues I should pay attention to.
Cheers,
Eleanor
Hi Eleanor,
The fixed-effects model does not work because of the missing data. The random-effects model works but it may take a while to run.
random2<-tssem1 (My.R, Myn, method = "REM", RE.type = "Diag", acov = "weighted")
random2 <- rerun(random2)
summary(random2)
Best,
Mike
Hi Mike,
Following your advice, I have got the results of the random-effect model, after running the program for quite a while. Seems I need a bit more patience with my computer :-)
Thank you very much for your time and kind help!
Cheers,
Eleanor