# Cov is not positive definite in tssem2

8 posts / 0 new
Offline
Joined: 01/23/2017 - 16:31
Cov is not positive definite in tssem2
AttachmentSize
2.31 KB
1.28 KB

Hi Mike,

Thank you so much answering all these questions on this forum. I was able to solve a lot of practical problems I ran into in my study.

But I am not sure how to solve this one properly: (code and data attached)
I successfully ran the tssem1 with my data, and was informed the Cov is not positive definite in the second stage.
I am a little bit confused as the result for tssem1 looks normal.

Why am I getting this error? Is it because I have too many missing values in the dataset?
If that is the case, should I try to combine variables and investigate at a higher level, or should I drop studies with too many missing values (e.g., studies reporting only 1 correlation) to reduce the missing value rate?

Offline
Joined: 10/08/2009 - 22:37
Hi Arant,

Hi Arant,

The stage-one analysis does not check whether or not the average correlation matrix is positive definite. If you check it, it is not.

> is.pd(vec2symMat(coef(random1, select="fixed"), diag=FALSE))
[1] FALSE

When you check the individual studies, studies 8 and 9 are not positive definite. You may consider dropping them from the analysis.

> is.pd(data3$data) 1 2 3 4 5 6 7 8 9 10 11 NA NA NA NA NA NA NA FALSE FALSE NA NA 12 13 14 15 16 17 18 19 20 21 22 NA NA NA NA NA NA NA NA NA NA NA 23 24 25 26 27 28 29 30 31 32 33 NA NA NA NA NA NA NA NA NA NA NA 34 35 36 37 38 39 40 41 42 43 44 NA NA NA NA NA NA NA NA NA NA NA 45 46 47 48 49 50 51 52 53 54 55 NA NA NA NA NA NA NA NA NA NA NA 56 57 58 59 60 61 62 63 64 65 66 NA NA NA NA NA NA NA NA NA TRUE NA 67 68 69 70 71 72 73 74 75 76 NA NA NA NA NA NA NA NA NA NA When you further check the numbers of studies, there are only a few for specific correlation coefficients. If you drop studies 8 and 9, there will be even fewer studies. > pattern.na(data3$data, show.na=FALSE)
SUB DIS WS NE OS
SUB 76 3 25 39 9
DIS 3 76 29 4 17
WS 25 29 76 5 21
NE 39 4 5 76 22
OS 9 17 21 22 76

Yes, it may be a good idea to either combine some of these variables or drop some of these variables.

Mike

Offline
Joined: 01/23/2017 - 16:31
Hi Mike,

Hi Mike,

I will talk with my coauthor about the model modification for sure.

By the way, do you see any other potential ways to overcome this issue?(I guess only by collecting more studies?)

Offline
Joined: 06/28/2016 - 04:51
Dear Mike,

Dear Mike,

unfortunately I have the same problem with non-positive definite correlation matrix at the second stage, but all my original matrices are positive definite, so I'm wondering how can it happen and what should I do now.
I hope you can help me!

File attachments:
Offline
Joined: 10/08/2009 - 22:37
Dear Anastasia,

Dear Anastasia,

By checking the data, there is only one study in many of these correlation coefficients. I don't think that we can call it a "meta-analysis." Maybe you should simplify your model with only x1 to x8.

> pattern.na(Corrs1DTB5H6, show.na=F)
x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14
x1  33 31 31 24 25 26 27 29  4   3   3   3   3   3
x2  31 33 31 25 26 27 27 28  4   3   3   3   3   3
x3  31 31 33 24 25 26 28 29  4   3   3   3   3   3
x4  24 25 24 33 17 17 17 17  1   1   1   1   1   1
x5  25 26 25 17 33 17 18 18  1   1   1   1   1   1
x6  26 27 26 17 17 33 17 19  1   1   1   1   1   1
x7  27 27 28 17 18 17 33 19  1   1   1   1   1   1
x8  29 28 29 17 18 19 19 33  1   1   1   1   1   1
x9   4  4  4  1  1  1  1  1 33   2   2   2   2   2
x10  3  3  3  1  1  1  1  1  2  33   2   2   2   2
x11  3  3  3  1  1  1  1  1  2   2  33   2   2   2
x12  3  3  3  1  1  1  1  1  2   2   2  33   2   2
x13  3  3  3  1  1  1  1  1  2   2   2   2  33   2
x14  3  3  3  1  1  1  1  1  2   2   2   2   2  33

Best,
Mike

Offline
Joined: 06/28/2016 - 04:51
Dear Mike,

Dear Mike,

Thank you for a quick reply!
In the main part of my analyses I focus on the variables 1 to 8, but I also would like to test a model with all 14 variables to see a tendency.
The only one whole matrix seems not to be a reason for the problem: I have three similar datasets, each of them has only one whole matrix, two of them have non-positive definite correlation matrices at the end of stage one, but the third one works fine as well as a large model with all three datasets together.
I would very appreciate if you could check the data again.

Anastasia

File attachments:
Offline
Joined: 10/08/2009 - 22:37
Dear Anastasia,

Dear Anastasia,

I trust that you should be able to check them yourself by using the pattern.na() function. For example,

pattern.na(Corrs1DTB5H6, show.na=F)

Best,
Mike

Offline
Joined: 06/28/2016 - 04:51
Dear Mike,

Dear Mike,

I did it and I know, that every of my datasets has only one full matrix. That seems not to be the problem, because the third dataset has a positive definite correlation matrix at the end of the stage one and stage two works without problems with only one full matrix in the original data. I thought, you could find other problems in the data or an another solution for my problem.

Best regards,
Anastasia