You are here

x is not positive definite! Help

3 posts / 0 new
Last post
Juanda's picture
Offline
Joined: 05/18/2016 - 18:35
x is not positive definite! Help
AttachmentSize
Image icon model.png29.76 KB
Plain text icon dataset158.txt7.33 KB
Binary Data scriptdataset158.R2.81 KB
Plain text icon dataset38.txt1.63 KB
Binary Data scriptdataset38.R2.21 KB

Dear Mike,

I'm a beginner in R and metaSEM. I'm performing a meta-analytic path model with 3 predictor variables, 1 mediator and 1 dependent variable (5 variables in total and 158 primary studies) as you can see in the figure.

I run the fix effects in the full dataset (158) but it is not possible because the missing values, but neither is possible to run the random effects (1stage).

I've notice the missing values problem due to the function is.pd, so I reduced the full dataset to 38 studies that cotains at least 1 value in the variable mediator, but it doesn't work. Curiously with a random set of 43 studies it was not a problem to run the random effects (1stage) (unfortunely I lost the dataset to probe it).

The problem is "x is not positive definite!". I don't understand why it happened in one case but in the other not.

1) Is there a way to solve this problem from the full dataset (158) without removing correlation matrices?

2) Taking in account the reduced dataset (38) is it possible to fix the "x is not positive definite!"?

3) By the way, following the rest of the code, is right specified?

I thank you in advance for your kind attention to this message and all the help you can provide me.

Mike Cheung's picture
Offline
Joined: 10/08/2009 - 22:37
Dear Juan, The problem is

Dear Juan,

The problem is related to the calculations of the asymptotic covariance matrix of the sample correlations. When we calculate the sampling covariance between r12 and r34, we need r12, r34, r13, r14, r23 and r24. If some of these elements are missing, there are problems. This may likely happen when there are lots of missing data.

One solution is to calculate the asymptotic covariance matrix based on the weighted or unweighted means of the correlation matrices. Since a complete correlation matrix is used, the missing data issue can be minimized. You may add either acov="weighted" or acov="unweighted" in calling tssem1(). You may refer to Cheung and Hafdahl (2016) for an illustration.

Cheung, M. W.-L., & Hafdahl, A. R. (2016). Special issue on meta-analytic structural equation modeling: Introduction from the guest editors. Research Synthesis Methods, 7(2), 112–120. http://doi.org/10.1002/jrsm.1212

Best,
Mike

Juanda's picture
Offline
Joined: 05/18/2016 - 18:35
Thanks a lot!!!

Dear Mike,

I am totally grateful for your help, it has been very useful. I will carefully read the article you mentioned.

You are the best.

Regards,

JDR