You are here

Error message on TSSEM1

14 posts / 0 new
Last post
Buil's picture
Offline
Joined: 10/07/2018 - 19:03
Error message on TSSEM1
AttachmentSize
Office spreadsheet icon data66 KB
File script5.16 KB

Dear Mike,
My name is B.I.Chung. I am writing a paper by MASEM analysis by using TSSEM procedure guided in your paper "Meta-analytic structural equation modeling". I sincerely appreciate all your explanation on the procedure of TSSEM in detail.
I prepared a correlation data for TSSEM from my previous meta-analysis and at the stage1 of Random-effects model, I am in trouble with below error message:

> stage1random <- tssem1(Cov=cordat, n=BI_MASEM_data_2$N, method="REM", RE.type="Diag")
Error in .Primitive("*")(dots[[1L]][[1L]], dots[[2L]][[1L]]) :
non-numeric argument to binary operator

I am a beginner of R program, so I don't know what the above error message means. Would you help me? I will appreciate it.

Best regards,

B.I.Chung

Mike Cheung's picture
Offline
Joined: 10/08/2009 - 22:37
Dear B.I.Chung,

Dear B.I.Chung,

This error is not related to the metaSEM package.

If you check the output of head(cordat), you will notice that cordat are character matrices. The tssem1() function expects numeric data. You may need to convert the characters to numerics before the analyses.

Regards,
Mike

Buil's picture
Offline
Joined: 10/07/2018 - 19:03
Error at TSSEM1

Dear Mike,

Thank you for your advise.
I converted the characters to numeric and run TSSEM1.
It seems to work, but I tried to get summary I had an error message as below.

random1 <- tssem1(cordat, n=dataset$N, method="REM", RE.type="Diag")
summary(random1)
Error in solve.default(t(X) %*% V_inv %*% X) : 
  Lapack routine dgesv: system is exactly singular: U[6,6] = 0

Please, review the above error and provide me with your advise.
I will appreciate it.

Best regards,
Buil

Buil's picture
Offline
Joined: 10/07/2018 - 19:03
Result of rerun()

Dear Mike,

I did rerun() and got the message as below.

> #### stage 1 
> stage1random <- tssem1(Cov=cordat, n=dataset$N, method="REM", RE.type="Diag")
> summary(stage1random)
Error in solve.default(t(X) %*% V_inv %*% X) : 
  Lapack routine dgesv: system is exactly singular: U[6,6] = 0
> random1_rerun <- rerun(stage1random)
 
All fit attempts resulted in errors - check starting values or model specification
 
> 

Would you let me know how to fix this problem?

Thanks,
Buil

Buil's picture
Offline
Joined: 10/07/2018 - 19:03
dataset & script

Dear Mike,

For your reference, data and script were attached.

Thanks,
Buil

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

Dear Buil,

For some correlation coefficients, there are only a few studies, e.g., 2 or 3. There may not be enough information for the meta-analysis.

> pattern.na(cordat,show.na=FALSE)
    RND CEO ABS COM TEC ENV REL PER
RND   4  11   6  10  24  15   3  36
CEO  11   7   6   9  11  11   9  28
ABS   6   6   6   4   5   4   2  27
COM  10   9   4  16  25  10  10  47
TEC  24  11   5  25  15  14   5  35
ENV  15  11   4  10  14  16   9  30
REL   3   9   2  10   5   9  25  34
PER  36  28  27  47  35  30  34  68

Regards,
Mike

Buil's picture
Offline
Joined: 10/07/2018 - 19:03
Summary of TSSEM1 result

Dear Mike,

Following your advise, I added more data and run TSSEM1. It worked.
Thank you so much for your help.
I found the below wording at last paragraph:

OpenMx status1: 6 ("0" or "1": The optimization is considered fine.
Other values may indicate problems.)

The result of my data got "6". Would it be okay with "6" instead of "0" or "1"? Your feedback would be appreciated.
For your refernce, the script and the result are attached.

Best regards,
Buil

File attachments: 
Buil's picture
Offline
Joined: 10/07/2018 - 19:03
Warning message at stage 2

Dear Mike,

I run the stage2 and the below warning message appeared.

> stage2 <- tssem2(stage1random, Amatrix=A, Smatrix=S,
+ diag.constraints = TRUE, intervals.type = "LB")
Warning message:
In .solve(x = object$mx.fit@output$calculatedHessian, parameters = my.name) :
Error in solving the Hessian matrix. Generalized inverse is used. The standard errors may not be trustworthy.

What was wrong? How can I fix the problems? Thanks in advance for your help.
For your reference, the script and result of stage2 are attached.

Best regards,
Buil,

File attachments: 
Mike Cheung's picture
Offline
Joined: 10/08/2009 - 22:37
Dear Buil,

Dear Buil,

The detail of the error codes in OpenMx is listed at https://openmx.ssri.psu.edu/wiki/errors

I am afraid that I cannot run your code. Could you please include the correct data file, R code, and R output?

Regards,
Mike

Buil's picture
Offline
Joined: 10/07/2018 - 19:03
error codes in OpenMx

Dear Mike,

Thank you for reply.
The data file, R code, and R output are attached.
I sincerely appreciate your help.

Thanks.
Buil

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

Dear Buil,

Thank you for providing more information.

The problem seems to be related to the stage 1 analysis. Since there are problems in the stage 1 analysis, you should not try the stage 2 analysis. It appears that you do not have enough data to estimate all the elements in the stage 1 analysis. You may need to simplify the model a bit.

Regards,
Mike

Buil's picture
Offline
Joined: 10/07/2018 - 19:03
Dear Mike,

Dear Mike,

Thank you for your explanation. I understood that I'm now stuck in stage 1 analysis.
As per your advise, I simplified the model by reducing the number of variables from 8 to 6 and excluded 27 correlation coefficients indices which contain only 1 or 2 data from original 72 studies.
And I run the TSSEM stage1 with this modified data set but it failed again with OpenMx status1: 6.
I cannot estimate what's wrong. And I really need your help. Please, advise me how I can continue my analysis.
I attached the modified data, R code, and R output for your reference.

Best regards,

Buil

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

Dear Buil,

The following ad-hoc fix may work.

## Customize the heterogeneity variance-covariance matrix
RE <- Diag(c(paste0("0.1*Tau2_", 1:5, "_", 1:5), 0,
             paste0("0.1*Tau2_", 7:10, "_", 7:10), 0,
             paste0("0.1*Tau2_", 12:15, "_", 12:15)))
stage1random <- tssem1(Cov=cordat, n=dataset$N, method="REM", RE.type="User",
                       RE.constraints = RE)

Regards,
Mike

Buil's picture
Offline
Joined: 10/07/2018 - 19:03
Dear Mike,

Dear Mike,

Thank you so much for your great support. The ad-hoc code worked very well although some NAs were still on the output which might be associated with my data. Thanks a lot for your help and really appreciate your time and consideration.

Best regards,
Buil

Log in or register to post comments