Regarding Cor2DataFrame Function

Posted on
No user picture. Aman Asija Joined: 03/04/2021
Forums

Dear Professor Cheung,

I am writing to seek your help regarding the Cor2DataFrame function.While converting correlation matrices into a dataframe using the function Cor2DataFrame (a list of 7 X 7 correlation matrices, list of corresponding sample sizes), we are receiving the following error: "Error in if (!is.pd(x.new)) stop("x is not positive definite!\n"): missing value where TRUE/FALSE needed". The error mentions that the matrices in the list are not positive definite. Further, we observed that the function is.pd(Matrix) outputs "NA" rather than TRUE/FALSE.

Please let us know your suggestions on how to overcome this issue.

Thank you for your time and help!

Best regards,
Aman Asija

Replied on Mon, 03/08/2021 - 19:54
Picture of user. Mike Cheung Joined: 10/08/2009

Dear Aman,

There are errors because there are not enough data for the analysis.


> pattern.na(MatrixList$data, show.na = FALSE)
V1 V2 V3 V4 V5 V6 V7
V1 5 3 3 1 0 0 1
V2 3 5 0 0 0 0 0
V3 3 0 5 0 0 0 0
V4 1 0 0 5 0 0 0
V5 0 0 0 0 5 0 0
V6 0 0 0 0 0 5 0
V7 1 0 0 0 0 0 5

Best,
Mike