[R] Pointwise Confidence Bounds on Logistic Regression

Rolf Turner r.turner at auckland.ac.nz
Wed Jun 18 22:48:01 CEST 2008


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

	cheers,

		Rolf Turner
######################################################################
Attention: 
This e-mail message is privileged and confidential. If you are not the 
intended recipient please delete the message and notify the sender. 
Any views or opinions presented are solely those of the author.

This e-mail has been scanned and cleared by MailMarshal 
www.marshalsoftware.com
######################################################################



More information about the R-help mailing list