Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Multilevel SEM


From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: Multilevel SEM
Date   Wed, 21 Dec 2011 15:18:05 -0600

Christopher Salas-Wright <[email protected]> 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
[email protected]
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index