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: Trouble with mixlogit (error) with binary dependent variable


From   Arne Risa Hole <arnehole@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Trouble with mixlogit (error) with binary dependent variable
Date   Tue, 5 Feb 2013 10:47:31 +0000

No. It should be a unique identifier for every occasion where a firm
had the choice between innovating or not. Look carefully at the
structure of the example datasets in the paper.

Arne

On 5 February 2013 01:50, SAM MCCAW <sam2stata@gmail.com> wrote:
> Thanks much. So if I have one variable, innovation, with a possible
> value of (0,1) then my group variable should just be group = 1?
>
> Thanks so much.
>
> SAM
>
> On Wed, Jan 30, 2013 at 6:36 AM, Arne Risa Hole <arnehole@gmail.com> wrote:
>> Sam
>>
>> -mixlogit- is a user-written command available from SJ/SSC.
>>
>> You've defined the group variable incorrectly - this should be an
>> identifier of the choice sets, not the alternatives within a choice
>> set. See the examples in
>> http://www.stata-journal.com/article.html?article=st0133.
>>
>> There might be other problems with the way you've set up the data too
>> but this is hard to know without seeing a snippet of the data. Have
>> you tried running the model using -clogit- first? If this doesn't work
>> you can be 100% sure that -mixlogit- won't either.
>>
>> Arne (author of -mixlogit-)
>>
>> On 30 January 2013 00:55, SAM MCCAW <sam2stata@gmail.com> wrote:
>>> Dear STATA gurus,
>>>
>>> I am having trouble running a mixed logit model. Please help!
>>>
>>> - The dependent variable is binary (0,1) (innovation).
>>>
>>> - My independent variables (var1 var2 var3) are continuous variables
>>> (they are logs of a count, excluding 0).
>>>
>>> -The group variable just takes a value of 1 or 2, because I only have
>>> two choice occasions, using: egen group = group(innov_1)
>>>
>>> - Code: mixlogit innov, group(group) rand(var1 var2 var3) id(id) or
>>>
>>>          mixlogit innov var4, group(group) rand(var1 var2 var3 var5) id(id)
>>>
>>> I am getting the following errors:
>>>
>>> [P]     error . . . . . . . . . . . . . . . . . . . . . . . . Return code 2000
>>>         no observations;
>>>         You have requested some statistical calculation and there are
>>>         no observations on which to perform it.  Perhaps you specified
>>>         if exp or in range and inadvertently filtered all the data.
>>>
>>> (end of search)
>>>
>>> I have over 30,000 for all the variables specified in the simplest
>>> model I ran and I still get the same error.
>>>
>>> Here are the sumamry statistics for my variables:
>>>
>>>     Variable |       Obs        Mean    Std. Dev.       Min        Max
>>> -------------+--------------------------------------------------------
>>> innov_1       |     32523    .4774467    .4994988          0          1
>>> var1            |     33065    2.104231    1.589854          0   4.859812
>>> var2            |     33065    1.669999      1.0031            0   4.060443
>>> var3            |     33065    .6736071    .9022467          0    3.78419
>>> var4            |     33065    2.141496    2.795201          0   9.953027
>>> -------------+--------------------------------------------------------
>>> var5            |     28893    1.506202    .9606917          0   3.295837
>>> var6            |      5953   -2.335463    1.106637   -4.60517    1.96611
>>>
>>> I am completely lost about what to do next.
>>>
>>> Thanks for your help.
>>>
>>> SAM
>>> *
>>> *   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/
>> *
>> *   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/
> *
> *   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/
*
*   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