Hi all. I am trying to develop an ado file that calls a maximum
likelihood estimator and am having a horrid time. I've included the
code below. When it reaches " ml model lf palogit (`dep'=`xvars'
`group') (delta: `group', nocons)", execution stops with "Unrecognized
command: palogit
program palogit not found".
Yet from the documentation and various examples, defining palogit at the
bottom of the program would appear to be a valid means of defining a
sub-routine. What am I doing wrong? Do I need to have palogit defined
as a separate ado file (I really hope not for ease of distribution)?
Many thanks for any help you can offer.
Glenn
*****
program define complogit
version 8.0
syntax varlist, Group(varlist min=1 max=1)
capture program drop palogit
//Parse variable list
gettoken dep xvars : varlist
//Run logit equations and save results
logit `dep' `xvars'
estimates store all
ml model lf palogit (`dep'=`xvars' `group') (delta: `group',
nocons)
ml search
ml maximize
end
program palogit
version 8
args lnf theta delta
quietly replace `lnf'= ///
$ML_y1 * `theta' * (1+`delta')- ///
ln(1+exp(`theta' * (1+`delta')))
end
Glenn Hoetker
Assistant Professor of Strategy
College of Business Administration
University of Illinois at Urbana-Champaign
217-265-4081
[email protected]
"Success is going from failure to failure without a loss of enthusiasm."
Sir Winston Churchill
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/