Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Multilevel SEM


From   jpitblado@stata.com (Jeff Pitblado, StataCorp LP)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Multilevel SEM
Date   Wed, 21 Dec 2011 15:18:05 -0600

Christopher Salas-Wright <christopher.wright.2@bc.edu> is getting a Mata
runtime error from -sem-:

> I have been having difficulty using multilevel (or second-order) structural
> equation models using Stata/IC 12.0.  I have had no problem running first
> order structural equation models with a combination of observed exogenous
> variables and latent endogenous variables using, for example, the following
> syntax:
> 
> sem (friend5 friend6 <- PEER) (gras7 gras8 <- BELIEFS) (drugcut drugcrit
> drugguil alc1 ciga1 drug1 <- SUBST)  (rcope_d -> PEER) (hodge5_d-> PEER)
> (empathy_d -> PEER) (ptsd_d -> PEER) (goodlivefam -> PEER) (edusingl->
> PEER) (gender-> PEER) (age1-> PEER) (PEER -> BELIEFS) (BELIEFS -> SUBST)
> (hodge5_d-> SUBST) (gender->SUBST) (goodlivefam->SUBST) if _mi_m ==0, cov
> (e.drugguil*e.drugcut) cov (e.drugcrit*e.drugcut)
> cov(e.drugcrit*e.drugguil) method (mlmv) stand
> 
> However, I receive a long error message (see below) every time that I try
> to write the syntax for a second order model for my dependent variable
> (SUBST), using the following syntax:
> 
> sem (friend5 friend6 <- PEER) (gras7 gras8 <- BELIEFS) (drugcut drugcrit
> drugguil <- ABU) (alc1 ciga1 drug1 <- USE) (ABU USE <- SUBST)  (rcope_d ->
> PEER) (hodge5_d-> PEER) (empathy_d -> PEER) (ptsd_d -> PEER) (goodlivefam
> -> PEER) (edusingl-> PEER) (gender-> PEER) (age1-> PEER) (PEER -> BELIEFS)
> (BELIEFS -> SUBST)   if _mi_m ==0, method (mlmv) stand
> 
> This is the error message:
> 
> "Fitting baseline model:
> 
> Iteration 0:   log likelihood = -3507.3904
> Iteration 1:   log likelihood = -3504.3428
> Iteration 2:   log likelihood = -3504.3299
> Iteration 3:   log likelihood = -3504.3299
> 
>               _sem_iv():  3301  subscript invalid
>    _sem_build__params():     -  function returned error
>            _sem_build():     -  function returned error
>            _sem_parse():     -  function returned error
> st_sem_parse_and_build():     -  function returned error
>                 <istmt>:     -  function returned error
> r(3301);"
> 
> Is anyone aware of the mistake I might be making?  Thank you!  My sample
> size is 300.

The Mata runtime error is a bug. We believe we have a fix for it, which should
be in the next Stata update.

Christopher is welcome to privately send me his data and a do-file that
reproduces the problem and I'll verify that we have this fixed.

--Jeff
jpitblado@stata.com
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index