You are here

"Cov" is not positive definite.

2 posts / 0 new
Last post
Srikanth's picture
Offline
Joined: 12/28/2016 - 15:36
"Cov" is not positive definite.
AttachmentSize
Binary Data R Script.R1.48 KB
Plain text icon data.txt5.12 KB
Image icon Model.png101.11 KB

Dear Mike and Others,

I am trying to estimate a random effects tssem for my paper.I have read your book and related papers. I am following the wonderful resources provided by you and your team. My goal is to perform some moderator analyses using categorical variables, after I successfully run the tssem model.

I am attaching my data, R script and the structural model. In this data and model, the tssem1 did not execute due to the positive definite problem. So, I followed your suggestions in Cheung and Hafdahl (2016), and hence tried adding the options acov = "weighted" and acov = "unweighted". This helped in successfully running the tssem1 model. But the tssem2 model produced the following error:

Error in wls(Cov = pooledS, asyCov = asyCov, n = tssem1.obj$total.n, Amatrix = Amatrix, :
"Cov" is not positive definite.

Indeed, the matrix was not positive definte when I inspected. How do I work around this error? How can I find a subset of studies in my dataset that is positive definite (without loosing the data points)? Interestingly, the tssem1 worked when I ran the with the first 40 studies in this dataset (even without the acov option).

I find the multivariate metasem to be fascinating. I want to strengthen my paper with this rigorous approach to metasem. So, any help in solving my issue would be great.

Thanks in advance for your help.
Regards,
Srikanth Parameswaran

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

Hi Srikanth,

There is an error in reading correlation matrix 70. The correlation between x3 and x4 is 48. After correcting it, it works fine with me.

my.df6[[70]]
x1 x2 x3 x4 x5
x1 1.00 0.51 0.68 0.35 NA
x2 0.51 1.00 0.47 0.50 NA
x3 0.68 0.47 1.00 48.00 NA
x4 0.35 0.50 48.00 1.00 NA
x5 NA NA NA NA 1

Regards,
Mike