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

RE: st: Residuals in Logistic Regression

From   Richard Williams <>
Subject   RE: st: Residuals in Logistic Regression
Date   Tue, 13 Apr 2004 10:36:51 -0500

At 10:13 AM 4/13/2004 -0400, VISINTAINER PAUL wrote:
Just as one more example, if you replace MPG with PRICE (a continuous
variable with one observation per value) in Nick's program, the -logit-
command produces the same dev's as -glm-, because each observation is a
unique covariate pattern. So if your model contains at least one
continuous variable, you are likely to get very close agreement among
commands, as well as programs.
Also, if you don't mind results being slightly off in the 4th or 5th decimal place, I found that something like this works pretty good:

drawnorm e, sd(.001)
gen educ2 = educ + e
quietly logit happymar church female educ2
predict dev, deviance

That is, you add some extremely small random number to one of your variables. In this case (and you should of course check this out) it made virtually no difference in the parameter estimates. But, every covariate pattern was then unique and I got deviance residual results virtually identical to SPSS's. Probably not the "best" way to do it but it is easy and seems to work. (Like I said before, the fact that such trivial differences in covariate values can create such big differences in the residuals is one of the things that strikes me as odd about the covariate pattern approach.)

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: Richard.A.Williams.5@ND.Edu
WWW (personal):
WWW (department):

* For searches and help try:

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