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: Calling -ml- program with more than one equation!
From
Peter Grand <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Calling -ml- program with more than one equation!
Date
Fri, 23 Mar 2012 13:10:39 +0000
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/