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: AW: RE: Calling -ml- program with more than one equation!


From   Peter Grand <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: AW: RE: Calling -ml- program with more than one equation!
Date   Fri, 23 Mar 2012 13:37:08 +0000

Hi Jean-Francois!

First, thank you for the references you sent me a few days ago!

I know that. However, I try to understand what happens `within' Stata if I call the ml program with the empty secod parenthesis and why that specific error message shows up.

Best,

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

________________________________________
Von: [email protected] [[email protected]]&quot; im Auftrag von &quot;[email protected] [[email protected]]
Gesendet: Freitag, 23. März 2012 14:21
Bis: [email protected]
Betreff: st: RE: Calling -ml- program with more than one equation!

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/

*
*   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