[R] Pointwise Confidence Bounds on Logistic Regression

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jun 18 23:32:48 CEST 2008


On Thu, 19 Jun 2008, Rolf Turner wrote:

>
> On 19/06/2008, at 8:08 AM, Bryan Hanson wrote:
>
>> Hi all.  I hope I have my terminology right here...
>> 
>> For a simple lm, one can add “pointwise confidence bounds” to a fitted line
>> using something like
>> 
>>> predict(results.lm, newdata = something, interval = "confidence")
>> 
>> (I'm following DAAG page 154-155 for this)
>> 
>> I would like to do the same thing for a glm of the logistic regression 
>> type,
>> for instance, the example in MASS pg 190-192 (available in the help page 
>> for
>> predict.glm).
>> 
>> However, predict.glm does not have the same kind of features as "plain old"
>> predict, i.e. One cannot specify interval = "confidence"
>
> 	I guess that one reason for that is that prediction intervals
> 	rarely if ever make sense with generalized linear models.  So only
> 	one kind of interval is in effect possible.
>> 
>>> From what I've read, "pointwise confidence bounds" are computed from the
>> SE's for each point.  However, I don't see quite where to extract this
>> information with a glm
>> 
>> So, is there an existing function that does what I am describing for a glm,
>> or can someone point me in the right direction to start writing my own?
>
> Use predict(<whatever>,type="response",se.fit=TRUE).  You get a list with
> three components, the first two of which are the fitted values and their
> standard errors.  (The third is the ``scale'' factor, usually/often equal to 
> 1.)

I would suggest rather computing confidence intervals on linear predictor 
scale and transforming those to response scale.  That way you will not get 
e.g. negative values for probabilities in a logistic regression.

>
> 	cheers,
>
> 		Rolf Turner

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


More information about the R-help mailing list