You are here

Advice for '"aCov" is not positive definite' error

2 posts / 0 new
Last post
AndrewLivingstone's picture
Joined: 06/01/2022 - 11:55
Advice for '"aCov" is not positive definite' error

Dear Mike and forum

I’d be very grateful for any advice on a problem running a tssem testing indirect effects. It is a ‘mini’/internal meta-analysis of three studies which assessed the same variables in different samples. The model has 3 predictors, 2 mediators, and one outcome variable per analysis.

For five out six outcome variables (run in separate models), all is well – but for one (self-esteem), I get the following error after getting to the tssem2 stage:

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

I understand that this means that the covariance matrix is not positive definite, but the perplexing thing is that (1) the individual and pooled matrices look ok on visual inspection, and (2) a is.pd check indicates that the matrix is positive definite – the code below returns ‘TRUE’:

is.pd(vec2symMat(coef(Selfesteemrandom1, select="random"), diag=FALSE))

Attached are the R code and the .dat file with the original correlation matrices.

Many thanks indeed for any help!

Best wishes

Mike Cheung's picture
Joined: 10/08/2009 - 22:37
Dear Andrew,

Dear Andrew,

There are 15 effect sizes in the random-effects model with 3 studies. This does not work as there are too few studies.