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: SEM: cannot correlate exogenous variable with endogenous variable


From   Jeremy Reynolds <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: SEM: cannot correlate exogenous variable with endogenous variable
Date   Mon, 1 Jul 2013 16:17:05 -0400

Dear Jeff,

Thank you very much for your suggestion.  Richard Williams also
responded and suggested a slightly different approach.  Specifically,
he constrained the error term for vic2 to zero and added a latent
variable with a path to vic2 that was constrained to 1.  The new
latent variable can then be correlated with off3.  If I have
implemented his suggestion correctly, the code would look like this:

*latent variable approach
#delimit ;
 sem
 (off1@off -> vic2)
 (off2@off -> vic3)
 (off3@off -> vic4)
 (vic1@vic -> vic2)
 (vic2@vic -> vic3)
 (vic3@vic -> vic4)
 (alpha@1 -> vic2 vic3 vic4)
 (B@1 -> vic2),
 covstruct(_lexogenous,diagonal)
 cov(_lexogenous*_oexogenous@0)
 latent(alpha B)
 cov(off1*alpha off2*alpha off3*alpha
 vic1*alpha
 off2*off3 off2*off1 off1*off3
 vic1*off1 vic1*off2 vic1*off3
 e.vic3@resid e.vic4@resid
 e.vic2@0
 B*off3)
 nocapslatent;
#delimit cr


Both your approach and this one produce similar results with the
offending/victimization data, but the chi square tests at the end of
the output have different degrees of freedom. Your approach has 9
degrees of freedom, and the latent variable approach has 8.  I was
unsure what to make of the models because neither set of results seems
to match Allison's.  Consequently, I tried the example in the document
at:

 http://www.statisticalhorizons.com/wp-content/uploads/2012/01/Causal-Inference.pdf

This time, Richard Williams' latent variable approach was very close
to the published results, and your approach did not converge.  Maybe I
have made a mistake in implementing your solution.

 I would appreciate any comments you might have about this second
example and the differences between your intercept approach and the
latent variable approach.

Thanks,

Jeremy


 ************************
*Example with occupational data
 ************************

use "http://www.statisticalhorizons.com/wp-content/uploads/occ.dta";, clear

******
*Latent variable approach
******
#delimit ;
sem (mdwgf3@c2 -> mdwgf4) (mdwgf2@c2 -> mdwgf3) (mdwgf1@c2 -> mdwgf2)
(pf1@c1 -> mdwgf2) (pf2@c1 -> mdwgf3) (pf3@c1 -> mdwgf4)
(A@1 -> mdwgf3) (A@1 -> mdwgf2) (A@1 -> mdwgf4) (B@1 -> mdwgf2),
 covstruct(_lexogenous,diagonal) cov(_lexogenous*_oexogenous@0) latent(A B )
 cov(e.mdwgf2@0 A*mdwgf1 A*pf1 A*pf2 A*pf3 B*pf3) nocapslatent;
#delimit cr

******
*Jeff's intercept approach
******
#delimit ;
sem
        (_cons -> pf1)
        (_cons -> pf2)
        (_cons -> pf3)
        (_cons -> mdwgf1)
        (pf1@pf -> mdwgf2)
        (pf2@pf -> mdwgf3)
        (pf3@pf -> mdwgf4)
        (mdwgf1@mdwgf -> mdwgf2)
        (mdwgf2@mdwgf -> mdwgf3)
        (mdwgf3@mdwgf -> mdwgf4)
        (alpha@1 -> mdwgf2)
        (alpha@1 -> mdwgf3)
        (alpha@1 -> mdwgf4)
        (_cons@0 -> alpha)
        ,
        latent(alpha)
        covstr(e.pf1 e.pf2 e.pf3 e.alpha, unstructured)
        cov(
                e.mdwgf2@resid
                e.mdwgf3@resid
                e.mdwgf4@resid
                e.mdwgf1*e.alpha
                e.mdwgf1*e.pf1
                e.mdwgf1*e.pf2
                e.mdwgf1*e.pf3
                e.pf3*e.mdwgf2
        )
;
#delimit cr

On Sun, Jun 30, 2013 at 3:16 PM, Jeff Pitblado, StataCorp LP
<[email protected]> wrote:
> Jeremy Reynolds <[email protected]> is using -sem- and is having trouble
> specifying a model that appears to require a covariance between an exogenous
> variable and an endogenous variable.
>
>> I am attempting to estimate an SEM model that contains reciprocal
>> effects and lagged predictors.  The model is based on the work of Paul
>> Allison see:
>>
>> http://www.statisticalhorizons.com/wp-content/uploads/2012/01/Causal-Inference.pdf
>> (The model is also described on page 1247 of England et al. Social
>> Science Research 36: 2007 and in Allison's 2005 book, Fixed Effects
>> Regression Models Using SAS.)
>>
>> My code is below.  The model I estimate contains measures of
>> victimization at 4 points in time (vic1-vic4) and offending at 3
>> points in time (off1-off3), as well as a latent variable that measures
>> time-invariant fixed effects.
>>
>> The problem is that I am not able to specify a correlation between
>> off3 and vic2 as specified at the end of the cov option.  Stata
>> replies:
>>
>> invalid specification of covariance between 'vic2' and 'off3';
>>   'vic2' is an observed dependent variable and
>>   'off3' is an observed independent variable
>
> Based on a given model specification, -sem- categorizes variables as observed
> or latent and endogenous (dependent) or exogenous (independent).  -sem- allows
> all exogenous variables to covary, regardless of being latent or observed.
> However -sem- does not allow any endogenous variable to directly covary with
> any other variable, only regression paths and covariances between their
> associated error variables are allowed.  Based on Jeremy's model
> specification, -sem- recognized 'vic2' as endogenous.
>
>> This correlation, however, is essential to the model.  Allison writes,
>> "the assumption of sequential exogeneity is modelled by allowing the
>> error term at each point in time to be correlated with future values
>> of the time-dependent covariates, but not past values (Wooldridge
>> 2002)."
>>
>> It appears that the intended model can be estimated in SAS and MPlus.
>> Is Stata not able to to estimate this model?  I am more inclined to
>> think that I have made a mistake in specifying the model, but I cannot
>> find it.
>
> I believe Jeremy's model can be specified, we merely need to specify the
> exogenous variables as dependent variables without any independent predictors,
> except an intercept.  In this specification, -sem- will allow any covariance
> between the corresponding error variables.
>
> Here is how I modified Jeremy's model
>
> ***** BEGIN:
> #delimit ;
> sem
>         (_cons -> off1)
>         (_cons -> off2)
>         (_cons -> off3)
>         (_cons -> vic1)
>         (off1@off -> vic2)
>         (off2@off -> vic3)
>         (off3@off -> vic4)
>         (vic1@vic -> vic2)
>         (vic2@vic -> vic3)
>         (vic3@vic -> vic4)
>         (alpha@1 -> vic2)
>         (alpha@1 -> vic3)
>         (alpha@1 -> vic4)
>         (_cons@0 -> alpha)
>         ,
>         latent(alpha)
>         covstr(e.off1 e.off2 e.off3 e.alpha, unstructured)
>         cov(
>                 e.vic2@resid
>                 e.vic3@resid
>                 e.vic4@resid
>                 e.vic1*e.alpha
>                 e.vic1*e.off1
>                 e.vic1*e.off2
>                 e.vic1*e.off3
>                 e.off3*e.vic2
>         )
> ;
> #delimit cr
> ***** END:
>
> --Jeff
> [email protected]
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
>
>



-- 
********************
Dr. Jeremy Reynolds
Associate Professor
Undergraduate Coordinator
Department of Sociology
117 Baldwin Hall
University of Georgia
Athens, GA 30602-1611
Phone: (706) 583-8072
Web: http://uga.edu/soc/people/faculty/reynolds_jeremy.php
Fax: (706) 542-4320
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index