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: bayesmlogit


From   Matthew Baker <[email protected]>
To   [email protected]
Subject   Re: st: bayesmlogit
Date   Wed, 21 Aug 2013 17:53:42 -0400

Milena --

I am in the process of trying to put together an example that
replicates the problem and will post accordingly when I have a more
exact answer.

But let me also note that a little searching around on the web
revealed that this problem has also cropped up a couple of times with
clogit, and bayesmlogit uses clogit for starting values if none are
given. So, one thing you might do - based on the admittedly bold
assumption that the problem is caused by a difficulty in using clogit
in the process of generating start values - is specify a few starting
values using the "from" option and see how that goes. You can find out
exactly how to do this in the help file for bayesmlogit - you should
probably be able to get by with specifying just the means of the
parameters. You probably don't need to specify the covariance matrix
as well.

I hope that helps!

Matt Baker

On Wed, Aug 21, 2013 at 1:10 PM, Milena Przheska
<[email protected]> wrote:
> Hi Matthew,
>
> First of all, I like to express appreciation for the package you
> created. I was able to get the estimates.
>
> As for the r(1400) that I got, I will be more precise - the error message was:
>
> 1927 (group size) take 674 (# positives) combinations results in
> numeric overflow; computations cannot proceed
>
> This happened when I tried to run the code on a data set that had 7708
> rows for 4 levels of the group variable and 1927 unique values for the
> identifier variable.
> When I limited the scope of the data set to the first 2000 rows the
> command was executed. The first part of the output was:
>
> Bayesian Mixed Logit Model
>
> Acceptance rates:
> Fixed coefs              = 0.234
> Random coefs(ave,min,max)= 0.070, 0.005, 0.267
> Observations    =      2000
> Groups          =       500
> Choices         =         4
> Total draws     =      1000
> Burn-in draws   =         0
>
>
> I did not see any limitations in the help file for the command, so I
> didn't know  it could be a problem.
>
>
> Best regards,
> Milena
>
> On Wed, Aug 21, 2013 at 6:35 PM, Matthew Baker
> <[email protected]> wrote:
>> Well, that was easy! Nothing like reading through email, finding that
>> there was a problem with your package, and that it was solved so
>> efficiently. But let me ask: is the "variable overflow" issue related
>> to bayesmlogit? It doesn't seem to be but I just wanted to be sure.
>>
>> And thanks Nick!
>>
>> Matt Baker
>>
>> On Wed, Aug 21, 2013 at 12:13 PM, Milena Przheska
>> <[email protected]> wrote:
>>> Hi Nick,
>>>
>>> Thank you very much for your reply.
>>> The command did not return r(2000) after I encoded the variables, so
>>> your guess was spot on.
>>>
>>> It did return an error for variable overflow r(1400), but I know that
>>> is a totally different issue.
>>>
>>> I am relatively new to Stata, so I apologize if I violated some code
>>> of conduct or failed to supply appropriate reference in my previous
>>> message.
>>>
>>> In that regard, I would like to supplement my previous message with
>>> the reference to the package I used to run the command
>>>
>>> package bayesmlogit from http://fmwww.bc.edu/RePEc/bocode/b
>>> Author: Matthew Baker, Hunter College
>>>
>>> Once again, thank you very much.
>>>
>>> Best,
>>> Milena
>>>
>>>
>>>
>>> On Wed, Aug 21, 2013 at 5:16 PM, Nick Cox <[email protected]> wrote:
>>>> -bayesmlogit- (SSC) is user-written. Please remember to explain where
>>>> user-written programs come from.
>>>>
>>>> At a guess, your -rand- is a string variable but -bayesmlogit- wants
>>>> it to be numeric. If so, use -encode- to produce a numeric variable
>>>> with value labels.
>>>> Nick
>>>> [email protected]
>>>>
>>>>
>>>> On 21 August 2013 16:09, Milena Przheska
>>>> <[email protected]> wrote:
>>>>> Dear Statalist members,
>>>>>
>>>>> I got error "no observations" r(2000) after running -bayesmlogit-
>>>>>
>>>>> I have a data set that contains choices of subjects at 4 separate
>>>>> occasions, and a dependent variable - a dichotomous variable.
>>>>>
>>>>> The data set looks like this:
>>>>>
>>>>> id           time         prior           y
>>>>> 1               1              a            0
>>>>> 1               2              a            0
>>>>> 1               3              b            1
>>>>> 1               4              c            0
>>>>> 2               1               c           1
>>>>> 2               2               c           0
>>>>> 2               3               b           1
>>>>> 2               4               a           0
>>>>> 3               1               d           0
>>>>> 3                2              d           0
>>>>> 3                3              a           1
>>>>> 3                4              c           1
>>>>>
>>>>> The commands I ran were
>>>>>
>>>>> bayesmlogit y, group(time) identifier(id) rand(prior)
>>>>>
>>>>>
>>>>> and
>>>>>
>>>>>
>>>>> bayesmlogit y, group(id) identifier(id) rand(prior)
>>>>>
>>>>>
>>>>> Got the same error that there are no observations.
>>>>>
>>>>>
>>>>> Can anyone please explain why this error occurs?
>>>>>
>>>>>
>>>>> I appreciate your help and I thank you all in advance.
>>>>>
>>>>>
>>>>> Regards,
>>>>> Milena Przheska
>>>>> *
>>>>> *   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/
>>
>>
>>
>> --
>> Dr. Matthew J. Baker
>> Department of Economics
>> Hunter College and the Graduate Center, CUNY
>> *
>> *   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/



-- 
Dr. Matthew J. Baker
Department of Economics
Hunter College and the Graduate Center, CUNY
*
*   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