Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: comparing logit coefficients

From   Jeremy Reynolds <[email protected]>
To   [email protected]
Subject   st: comparing logit coefficients
Date   Wed, 25 Aug 2004 09:31:23 -0400

In 1999, Paul Allison published a paper in Sociological Methods & Research (vol. 28 issue 2 pages 186-208) about comparing logit coefficients across models. I am trying to use the Stata code that he included in the paper's appendix (see below). In particular, I want to compare coefficients for two logistic regression models, one with men and one with women, but I can't get the code to run properly.

Stata 8 seems to understand and define the program below, but the ml maximize statement does not run, and it produces the following error: "*__00000S invalid name ". I've checked and double-checked the program and my modified version of the model statement in the belief that I have simply typed something wrong, but I can't seem to figure out where the problem is.

Has anyone used Allison's program successfully? Any idea why the code below does not run?
Maybe my problem is with the maximize statement and not the program?



--Below I have listed the Stata code and comments from the appendix--

program define glogit
version 6
args lnf theta delta
quietly replace `lnf'=$ml_y1*`theta'*(1+`delta')-ln(1+exp(`theta'*(1+`delta')))

ml model lf glogit (prom = undgrd arts dur dur2 prest female) (delta: female,nocons)
ml maximize

The commands bracketed by PROGRAM and END define the estimation problem in a general way. These commands can be saved in a DO file and used for any data set or particular set of variables in the model. In the ML MODEL command, LF specifies the optimization algorithm and GLOGIT refers to the name of the program defined earlier.


* For searches and help try:

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