You are here

Unable to read data

3 posts / 0 new
Last post
Xin Lin's picture
Offline
Joined: 06/10/2019 - 15:24
Unable to read data

Hi Dr. Cheung and colleague,

I am trying to mimic your codes in your metaSEM article (cheung, 2018). I construct a fake dataset and try the tssem1 as following

a<-matrix(c(1,0.2,0.4,1),ncol=2)
b<-matrix(c(1,0.6,0.4,1),ncol=2)
c<-matrix(c(1,0.3,0.7,1),ncol=2)
d<-matrix(c(1,0.9,0.8,1),ncol=2)
e<-matrix(c(1,0.2,0.5,1),ncol=2)
f<-matrix(c(1,0.36,0.34,1),ncol=2)
g<-matrix(c(1,0.3,0.8,1),ncol=2)
h<-matrix(c(1,0.9,0.2,1),ncol=2)
i<-matrix(c(1,0.2,0.4,1),ncol=2)
mats<-list(a,b,c,d,e,f,g,h,i)
n<-c(5,7,20,39,6,29,30,78,29)

fixed1 <- tssem1(mats,n, method = "FEM")

That is a list of 2*2 var-cov matrices with some arbitrary sample sizes. However, I got the error message “Error in if (all.equal(covMatrix, t(covMatrix))) { : argument is not interpretable as logical’’ when running the tssem1.
I am wondering what is the problem. Is it because of the data format of my fake data and your example data (Becker, 2009)?

Thanks for your time and patience!

Mike Cheung's picture
Offline
Joined: 10/08/2009 - 22:37
Unable to read data

Dear Xin Lin,

The error message means that your covariance/correlation matrices are not symmetric. For example,

a<-matrix(c(1,0.2,0.4,1),ncol=2)
a
     [,1] [,2]
[1,]  1.0  0.4
[2,]  0.2  1.0

Best,
Mike

Xin Lin's picture
Offline
Joined: 06/10/2019 - 15:24
Dear Dr. Cheung,

Dear Dr. Cheung,

Your answer is very helpful for me.
I really appreciate your kind and timely response!

Best,
Xin