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

RE: st: Residuals in Logistic Regression

From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: Residuals in Logistic Regression
Date   Tue, 13 Apr 2004 16:48:35 +0100

I'd put it this way: if you buy the Hosmer-Lemeshow 
definition -- and in practice this only makes much 
difference with categorical or discrete predictors -- 
then -logit-'s definition is the one to follow. If not, 
go for -glm, link(logit)-. The difference may seem 
fortuitous, in that different commands follow different
literatures, but there's no reason to use a small random 
perturbation except for demonstration purposes, as here.  

[email protected] 

Richard Williams
> 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.)

*   For searches and help try:

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