Statalist


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

Re: st: non-nested random effects


From   Jacob Wegelin <[email protected]>
To   [email protected]
Subject   Re: st: non-nested random effects
Date   Tue, 7 Apr 2009 11:26:23 -0400

Dear Johan and Bobby,

Thanks very much for your replies. Now the code leads to an error as follows:

. xtmixed FinishTime Sex01F PL2Age2 Sex01FxPL2Age2 PL2Age3
nFin1974toPrev MinCC PzCDrp MinCCxPzCDrp || _all:R.NAME || Year:

Performing EM optimization:
likelihood evaluates to missing
r(430);

end of do-file

r(430);

.  xtmixed FinishTime Sex01F PL2Age2 Sex01FxPL2Age2 PL2Age3
nFin1974toPrev MinCC PzCDrp MinCCxPzCDrp || _all: R.NAME || _all:
R.Year

Performing EM optimization:
likelihood evaluates to missing
r(430);

The syntax of the 2nd command is copied from an example in the xtmixed
on-line help file under “Two-way crossed random effects.”

The first error was returned after a delay of about 4 minutes, the
second after a similar delay. By contrast, I fit the same model just
now in R (library lme4) on the same MacBook Pro using the same data
and it returned a reasonable-looking answer in under two seconds.

Do you see any mistake in the syntax of the Stata commands?

If the Stata command is syntactically correct, I'm guessing that one
possible explanation for the delay and eventual error is a numerical
difficulty caused by a sparse matrix. The R library is designed to
handle sparse matrices.

When I attempted to fit this model in SAS using GLIMMIX, the software
hung for several hours. My guess is that only software specifically
designed for sparse matrices can fit this model on these data (5000
observations, 22 Year levels, 2900 NAME levels). If this is the case,
does Stata plan to add sparse matrix capability?

I would read your thoughts on this with interest.

Thanks

Jake

Jacob A. Wegelin
Assistant Professor
Department of Biostatistics
Virginia Commonwealth University
730 East Broad Street Room 3006
P. O. Box 980032
Richmond VA 23298-0032
U.S.A.
E-mail: [email protected]
URL: http://www.people.vcu.edu/~jwegelin


On Tue, Apr 7, 2009 at 10:11 AM, Roberto G. Gutierrez, StataCorp
<[email protected]> wrote:
> Within this thread, Johan Hellstrom <[email protected]> gives
> the following good advice to which I would suggest one small change:
>
>> Your Stata code...
>
>> xtmixed FinishTime Sex01F PL2Age2 Sex01FxPL2Age2 PL2Age3 nFin1974toPrev
>> MinCC PzCDrp MinCCxPzCDrp || NAME: || Year:
>
>> ...implies that Year is nested within NAME. If I understand you correctly,
>> the model you want to estimate is rather this one (?) :
>
>> xtmixed FinishTime Sex01F PL2Age2 Sex01FxPL2Age2 PL2Age3 nFin1974toPrev
>> MinCC PzCDrp MinCCxPzCDrp || _all:R.NAME: || Year:
>
> Leave the colon (:) off the end of "R.NAME".
>
> --Bobby
> [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/
>

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index