multi-group WLS

Posted on
No user picture. pascofearon Joined: 05/07/2013
Forums

Hi Mike,
Hope this finds you well. I'm trying to run a multi-group SEM (twin data) using summary statistics rather than raw data. I have the covariance and asymptotic covariance matrices. I think I'm hitting errors in the way I'm handling the multi-group aspect - as WLS says the following:

Error in withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning")) :
(list) object cannot be coerced to type 'double'

I've supplied the two matrices as lists - one for each group. The script is attached.

I also get this message:

In addition: Warning message:
In if (is.pd(Cov)) { :
the condition has length > 1 and only the first element will be used

Any help much appreciated as always!

Best,

Pasco

Replied on Sat, 08/15/2020 - 05:26
Picture of user. Mike Cheung Joined: 10/08/2009

Dear Pasco,

Attached is the code for your model.
You may note that the SEs in lavaan are different than those in OpenMx as the precision of the inputs is different in these two cases.

Best,
Mike

File attachments
Replied on Thu, 09/17/2020 - 06:27
No user picture. pascofearon Joined: 05/07/2013

Hi Mike,
I have a follow-up query about this - the model runs perfectly with your edits, and returns sensible looking parameter estimates and standard errors. However, when I add a request for confidence intervals I get very strange estimates. I'm not sure if my code is wrong, or there is a more fundamental issue with the likelihood-based intervals. The adjusted part of the code was just:

ace <- mxModel('All', gp1, gp2,
mxFitFunctionMultigroup(c('gp1.fitfunction', 'gp2.fitfunction')), mxCI(c('gp1.Amatrix'), interval = 0.95, type=c('both')))
fit1 <- mxRun(ace, intervals = TRUE)

Thanks for any help, as always!

Best,

Pasco

Replied on Fri, 09/18/2020 - 06:39
Picture of user. Mike Cheung Joined: 10/08/2009

Dear Pasco,

The parameter estimates with the LBCI are the same as those without the LBCI.

The model without the LBCI:

free parameters:
name matrix row col Estimate Std.Error A
1 a gp1.Amatrix P1 A1 0.87909044 0.110115
2 c gp1.Amatrix P1 C1 0.02645751 2.585079

The model with the LBCI:

free parameters:
name matrix row col Estimate Std.Error A
1 a gp1.Amatrix P1 A1 0.87909044 0.110115
2 c gp1.Amatrix P1 C1 0.02645751 2.585079

confidence intervals:
lbound estimate ubound note
a -0.9487976 0.87909044 0.9488027
c -0.5184616 0.02645751 0.5184611

Could you tell us what the issues are?

Best,
Mike