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   Clive Nicholas <[email protected]>
To   [email protected]
Subject   Re: st: Fixing an -ml model- syntax problem
Date   Tue, 20 Feb 2007 21:42:36 +0000 (GMT)

Richard Williams wrote:

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

That's a very good point. I was typing the code straight from what was printed by Allison in his article. Not being in any way an expert in -ml-, I assumed this was how the code should be. I couldn't see it, and it's worth noting that the subtraction operator did _not_ appear in Allison's Stata code.

I'm very comforted to see, as both Glenn Hoetker (who said the above was his code, interestingly!) and Arne Rise Hole pointed out, that Richard has already programmed an alternative: -oglm-. I have seen this mentioned before, but not taken much notice of it until now. How do they compare? Following Sergiy Radyakin's post and using -estout-:

                                       gplogit                        oglm                                   
                                       eq1           delta          choice        variance            cut1   
                                       b/t             b/t             b/t             b/t                     b/t   
age in current year            1.012***                      1.012***                                
                                       (5.007)                       (5.007)                                   
race black                        2.334***     0.980         2.334***     1.020                   
                                    (13.776)      (-0.291)     (13.775)       (0.289)                   
current grade completed    1.079***                      1.079***                                
                                    (10.923)                      (10.923)                                   
1 if south                          0.397***                     0.397***                                
                                   (-21.205)                     (-21.205)                                   
_cons                              0.080***                                                               12.458***
                                   (-22.484)                                                                 (22.484)   
Model chi square         1073.402                    1194.011                                   
Log psuedo-likelihood       -1.33e+04                  -1.33e+04                                   
Psuedo R^{2}                                                     0.043                                   
N                              26200                        26200                 

The model parameters and standard errors are exactly the same, but the model fit is better under -oglm-. The key issue, however, is the value of the $\{delta}$ parameter. under -gplogit-, $\{delta} < 0$, implying that residual variation is larger amongst blacks than amongst non-blacks. Under -oglm-, $\{delta} > 0$, which implies exactly the opposite. This throws up two follow-up questions:

(1) If both of these achieved significance here, how on Earth do you decide whether or not to include an interactive term in the model?

(2) Since they don't, is the inclusion of one 'legal' under -oglm- (they can be included in both routines and both run)? 

A rather large thanks to Arne, Glenn, Richard and Sergiy for their replies on this.

Clive Nicholas
 





		
___________________________________________________________ 
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html

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