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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: RE thread: SEM with categorical variables


From   Laura Maria Schwirz <schwirzl@tcd.ie>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE thread: SEM with categorical variables
Date   Wed, 13 Mar 2013 16:27:23 +0000

Apologies.
So basically the code suggested by Stas works just fine but obviosuly,
once I run the clear command, the data in memory is clear. So if I
then ask to set the correlation matrix, it cannot find it.

This works just fine.

local thevars hewsonstrong hewsonknowo hewsonint hewsoninspi
hewsonmoral hewsoncom hewsondecent hewsondepend hewsonrel hewsonsens

polychoric `thevars'

mat polychR = r(R)

 forvalues i=1/`: word count `thevars' ' {

 forvalues j=1/`i' {

 local setcor `setcor' `=polychR[`i',`j']'

 }

 if `i' < `: word count `thevars' ' local setcor `setcor' \

 }

 local N = _N


Problem arises here as memory is set clear and no data stored which is
essentially needed when setting ssd.

clear
 ssd init hewsonstrong hewsonknowo hewsonint hewsoninspi hewsonmoral
hewsoncom hewsondecent hewsondepend hewsonrel hewsonsens

 ssd set obs 1456

 --> ssd set cor `setcor': it cannot obviously find setcor as memory
has been cleared to run ssd command.


Hope this is clearer now.


Thanks,

Laura

On 13 March 2013 16:02, JVerkuilen (Gmail) <jvverkuilen@gmail.com> wrote:
> I'm afraid I have nothing specific to add but general troubleshooting
> advice is:
>
> Cut down on the number of degrees of freedom in the problem you want
> to solve. Try doing the analysis "by hand" as it were. So make the
> polychoric matrix, save it, use SEM to analyze, etc. See that that
> works. If it does, then the problem has to be somewhere in the .do
> file itself.
> *
> *   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/
>



--
Laura Schwirz

PhD Candidate and IRCHSS Scholar
Department of Political Science
Trinity College Dublin
Dublin 2
Republic of Ireland
Email: schwirzl@tcd.ie
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index