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]

st: RE: Calling -ml- program with more than one equation!


From   <[email protected]>
To   <[email protected]>
Subject   st: RE: Calling -ml- program with more than one equation!
Date   Fri, 23 Mar 2012 09:21:44 -0400

Hi Peter,

You only have one equation to evaluate, the second parenthesis is for a second equation that is not in your code (which is ok for a logit).

Jean-François Bertrand

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Peter Grand
Sent: March 23, 2012 9:11 AM
To: [email protected]
Subject: st: Calling -ml- program with more than one equation!

Dear Statauser!

Maybe that is a dumb question. I have written a conditional logit ml program, which works fine when I call it as follows:

ml model d0 myclog (Eq1: vote_choice_eu=u_pr_eu pid, nocons) ;

However, if I call it with 

ml model d0 myclog (Eq1: vote_choice_eu=u_pr_eu pid, nocons) ();

I get the error message:

`could not calculate numerical derivatives -- discontinuous region with missing values encountered'

Does anyone know what happens if I call a d0 program with extra parenthesis, but do not add a second equation with mleval?

Thank you very much for your help!

Best,

Peter Grand

****************************************************************
program myclog ;
args todo b lnf ;
tempvar denom p xb ;
local by $MY_panel ;
mleval `xb' = `b', eq(1) ;
qui { ;
egen double `denom' = sum(exp(`xb')), by(`by') ; gen double `p' = exp(`xb')/`denom' ; mlsum `lnf' = $ML_y1*ln(`p') if $ML_y1==1 ; if (`todo'==0 | `lnf'>=.) exit ; } ; end ;
****************************************************************

Peter Grand
grand(at)ihs.ac.at
Institute for Advanced Studies
Stumpergasse 56
1060 Vienna

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index