You are here

Fitting 2 stage random effects (with indirect effects)

3 posts / 0 new
Last post
Bfcastilla's picture
Offline
Joined: 09/11/2014 - 09:07
Fitting 2 stage random effects (with indirect effects)
AttachmentSize
File DATOS22.dat635 bytes
Image icon Path model.png12.39 KB
Binary Data CommandR.R1.16 KB

Dear Mike,

I am having some problems when fitting a path model in the second stage (Random Effects Model) which includes some indirect effects. In the documents attached you can find the data (.dat), the commands I used (.R) and the path model I would like to fit (.png).

The error that appears is the next one:

Error in $<-.data.frame(*tmp*, "Std.Error", value = NA) :
replacement has 1 row, data has 0
In addition: Warning messages:
1: In pchisq(tT, df = dfT, lower.tail = FALSE) : NaNs produced
2: In sqrt(max((tT - dfT)/(n - 1), 0)/dfT) : NaNs produced
Warning message:
In model 'TSSEM2 random effects model' NPSOL returned a non-zero status code 1. The final iterate satisfies the optimality conditions to the accuracy requested, but the sequence of iterates has not yet converged. NPSOL was terminated because no further improvement could be made in the merit function (Mx status GREEN).

Thanks in advance,

Belén.

Mike Cheung's picture
Offline
Joined: 10/08/2009 - 22:37
Dear Belén, It's attributed

Dear Belén,

It's attributed by a mix of coding error and a bug in metaSEM.

  1. The labels of "CorEH" and "CorrHE" in S1 should be the same. They were treated as two different parameters. Thus, the df was incorrectly computed as -1.

  2. I think that there should be a direct arrow from H to JP in the figure.

The latest metaSEM version (0.9) works fine. I am attaching the output for your reference. It is available at https://dl.dropboxusercontent.com/u/25182759/metaSEM_0.9-0.tar.gz However, it depends on the latest OpenMx 2.0. It is required to build it from the source repository
http://openmx.psyc.virginia.edu/wiki/howto-build-openmx-source-repository

Since your model is saturated, the fit indices are irrelevant. You may still get the parameter estimates and their confidence intervals by calling summary(random2$mx.fit).

Hope it helps.

Mike

Bfcastilla's picture
Offline
Joined: 09/11/2014 - 09:07
Thank you very much Mike! I

Thank you very much Mike! I really appreciate your time and dedication...It helped a lot!

King Regards,

Belén.