Re: logit transformation when predictor's a continuous variable

Frank E Harrell Jr (
Fri, 23 Jan 1998 11:05:56 -0500

Right Brian. I was saved by only considering moderately large
covariable effects and moderate to large sample sizes.

Back in the old days (1979) when I wrote the first SAS logistic and Cox
regression procedures, I had special code for taking care of these
'large beta' cases. -Frank

-----Original Message-----
From: Prof Brian Ripley <>
To: <>
Cc: <>; <>
Date: Friday, January 23, 1998 1:17 AM
Subject: Re: logit transformation when predictor's a continuous variable

>Frank E Harrell Jr wrote:
>> Jan,
>> In doing simulations to study bootstrap error estimates, you should not
>> have to deal with any p=0 or p=1, as you use maximum likelihood to
>> estimate the regression coefficients and don't actually use the logit
>> transformation in the fitting process.
>Sorry Frank, but you _may_ have to deal with p = 0 or 1. There's a
>phenomenon know as (partial) separation in which the MLE gives
>fitted probabilities for some cases of 0 and 1 (and hence some
>infinite coefficients). Consider data like:
> y y y y
>x x x x x
>and if you bootstrap you increase the chance of this happening (for
>some ratio around 3 of n to p, the number of predictors, the
>increase is large by a famous formula of Cover.)
>I have always maintained that one should handle such cases separately,
>as the standard glm IWLS algorithm `converges' rather slowly. More
>details and some follow-up references are in Chapter 3 (esp p.113)
>of my PRNN book.
>On the original question, glm() does use care.exp() in its calculations,
>and essentially takes log(0) as about -30.
>> -----Original Message-----
>> From: Jan Muska <>
>> To: <>
>> Date: Thursday, January 22, 1998 2:29 AM
>> Subject: logit transformation when predictor's a continuous variable
>> >I want to do a simmulation study on Efron's prediction error estimators
>> >(632 and 632+, and some other ones). One of the decision rules I want to
>> >test this on is logistic regression (logit). My problem is I cannot find
>> >FORTRAN code to do the logit transformation when the predictor is a
>> >continuous variable. I can't even find any reference-just do not know
>> >where to look. Does anybody know how to do this transformation
>> >log(p/(1-p)) when p=1 or 0?
>> >
>> >I found a on internet an approximation such as if p=1, then p=1-1/2*n.
>> >But this does not seem to provide the same answer as the GLM procedure in
>> >S-Plus using the binary link.
>> >
>> >If you can send me a reference where to look or how to do this
>> >transformation, I'll be greatfull. For this is the only think that is
>> >keeping me from running the simulation and getting done with my
>> >disertation.
>> >
>> >Thanks, Jan Muska
>> >
>> >
>Brian D. Ripley,
>Professor of Applied Statistics,
>University of Oxford, Tel: +44 1865 272861 (self)
>1 South Parks Road, +44 1865 272860 (secr)
>Oxford OX1 3TG, UK Fax: +44 1865 272595