Re: [R] Confidence Intervals for logistic regression

2010-08-07 Thread Ben Bolker
manchester.ac.uk> writes: > > On 07-Aug-10 09:29:41, Michael Bedward wrote: > > Thanks for that clarification Peter - much appreciated. > > > > Is there an R function that you'd recommend for calculating > > more valid CIs ? > > Michael > > It depends on what you want to mean by "more valid"!

Re: [R] Confidence Intervals for logistic regression

2010-08-07 Thread Peter Dalgaard
Michael Bedward wrote: > On 7 August 2010 19:56, Martin Maechler wrote: > >> I'm coming late to the thread, >> but it seems that nobody has yet given the advice which I would >> very *strongly* suggest to anyone asking for confidence >> intervals in GLMs: >> >> Use confint() > > confint was actu

Re: [R] Confidence Intervals for logistic regression

2010-08-07 Thread Ted Harding
On 07-Aug-10 09:29:41, Michael Bedward wrote: > Thanks for that clarification Peter - much appreciated. > > Is there an R function that you'd recommend for calculating > more valid CIs ? > Michael It depends on what you want to mean by "more valid"! If you have a 95% CI for the linear predictor (

Re: [R] Confidence Intervals for logistic regression

2010-08-07 Thread Michael Bedward
On 7 August 2010 19:56, Martin Maechler wrote: > I'm coming late to the thread, > but it seems that nobody has yet given the advice which I would > very *strongly* suggest to anyone asking for confidence > intervals in GLMs: > > Use  confint() confint was actually mentioned in the second post on

Re: [R] Confidence Intervals for logistic regression

2010-08-07 Thread Martin Maechler
> "PD" == Peter Dalgaard > on Sat, 07 Aug 2010 10:37:49 +0200 writes: PD> Michael Bedward wrote: >>> I was aware of this option. I was assuming it was not ok to do fit +/- 1.96 >>> se when you requested probabilities. If this is legitimate then all the >>> better.

Re: [R] Confidence Intervals for logistic regression

2010-08-07 Thread Michael Bedward
Thanks for that clarification Peter - much appreciated. Is there an R function that you'd recommend for calculating more valid CIs ? Michael On 7 August 2010 18:37, Peter Dalgaard wrote: > > Probably, neither is optimal, although any transformed scale is > asymptotically equivalent. E.g., neith

Re: [R] Confidence Intervals for logistic regression

2010-08-07 Thread Peter Dalgaard
Michael Bedward wrote: >> I was aware of this option. I was assuming it was not ok to do fit +/- 1.96 >> se when you requested probabilities. If this is legitimate then all the >> better. > > I don't think it is. I understood that you should do the calculation > in the scale of the linear predi

Re: [R] Confidence Intervals for logistic regression

2010-08-07 Thread Troy S
> Stefano > > -Messaggio originale- > Da: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org]per conto di Troy S > Inviato: Friday, August 06, 2010 6:31 PM > A: Michael Bedward > Cc: r-help@r-project.org > Oggetto: Re: [R] Confidence Intervals for

Re: [R] Confidence Intervals for logistic regression

2010-08-07 Thread Michael Bedward
> I was aware of this option.  I was assuming it was not ok to do fit +/- 1.96 > se when you requested probabilities.  If this is legitimate then all the > better. I don't think it is. I understood that you should do the calculation in the scale of the linear predictor and then transform to proba

[R] R: Confidence Intervals for logistic regression

2010-08-06 Thread Guazzetti Stefano
rgument at the end of the page. Stefano -Messaggio originale- Da: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]per conto di Troy S Inviato: Friday, August 06, 2010 6:31 PM A: Michael Bedward Cc: r-help@r-project.org Oggetto: Re: [R] Confidence Intervals for logistic reg

Re: [R] Confidence Intervals for logistic regression

2010-08-06 Thread Troy S
Michael, Thanks for the reply. I believe Aline was sgiving me CI's on coefficients as well. So c(pred$fit + 1.96 * pred$se.fit, pred$fit - 1.96 * pred$se.fit) gives me the CI on the logits if I understand correctly? Maybe the help on predict.glm can be updated. Thanks! On 6 August 2010 01:46,

Re: [R] Confidence Intervals for logistic regression

2010-08-06 Thread Michael Bedward
Sorry about earlier reply - didn't read your email properly (obviously :) You're suggestion was right, so as well as method for Aline below, another way of doing the same thing is: pred <- predict(y.glm, newdata= something, se.fit=TRUE) ci <- matrix( c(pred$fit + 1.96 * pred$se.fit, pred$fit - 1.

Re: [R] Confidence Intervals for logistic regression

2010-08-06 Thread aline uwimana
Dear Troy, use this commend, your will get IC95% and OR. logistic.model <- glm(formula =y~ x1+x2, family = binomial) summary(logistic.model) sum.coef<-summary(logistic.model)$coef est<-exp(sum.coef[,1]) upper.ci<-exp(sum.coef[,1]+1.96*sum.coef[,2]) lower.ci<-exp(sum.coef[,1]-1.96*sum.coef[,2])

[R] Confidence Intervals for logistic regression

2010-08-05 Thread Troy S
Dear UseRs, I have fitted a logistic regression using glm and want a 95% confidence interval on a response probability. Can I use predict(model, newdata, se.fit=T) Will fit +/- 1.96se give me a 95% of the logit? And then exp(fit +/- 1.96se) / (exp(fit +/- 1.96se) +1) to get the probabilities?