Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Fixing an -ml model- syntax problem


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: Fixing an -ml model- syntax problem
Date   Tue, 20 Feb 2007 13:04:55 -0500

At 12:10 PM 2/20/2007, Clive Nicholas wrote:
For fun, I thought I'd test out an old piece of Stata code I found in Allison (1999: 203-4) that fires up a logit model which takes into account unequal residual variation across groups. I'm sure it's just a minor thing, but I'm having problems running his Stata 6 routine, which utilizes -ml- code:

webuse union, clear
program define gplogit
version 6
args lnf theta delta
qui replace `lnf' =
$ML_y1*`theta'*(1+`delta')
ln(1+exp(`theta'*(1+`delta')))
end
ml model lf gplogit (union = age black grade south) ///
(delta: black,nocons)
ml maximize
You've split your code across lines; just because the journal typesetters can do that doesn't mean you can. It ought to be

qui replace `lnf' = $ML_y1*`theta'*(1+`delta') - ln(1+exp(`theta'*(1+`delta')))

As a sidelight, Allison's models can easily be estimated with -oglm-, available from SSC. For detailed discussion with code, see

http://www.nd.edu/~rwilliam/xsoc73994/Oglm1.pdf

http://www.nd.edu/~rwilliam/xsoc73994/Oglm2.pdf


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
*
* 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/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index