[R] glm logistic model, prediction intervals on impact af age 60 compared to age 30

Niels Steen Krogh nielssteenkrogh at hotmail.com
Mon Mar 1 02:23:14 CET 2004


Dear R-list.
I have done a logistic glm using Age as explanatory variable for some 
allergic event.

#the model
model2d<-glm(formula=AEorSAEInfecBac~Age,family=binomial("logit"),data=emrisk)
#predictions for age 30 and 60
preds<-predict(model2d,data.frame(Age=c(30,60)),se.fit=TRUE)
# prediction interval
predsxx<-cbind(fit=preds$fit,lower=preds$fit-1.96*preds$se,upper=preds$fit+1.96*preds$se)
#transformation
model2dres<-family(model2d)$linkinv(predsxx)


In my next step I want to know the confidence interval (CI) for the change 
in risk for the allergic event to occur for age 60 compared to age 30.
The estimates from the model suggest a 80 pct. higher risk for age 60 
compared to age 30.
(100*model2dres[2]/model2dres[1])

But how should I get the 95% CI of the 80pct. increase??

I've looked in the effects package but  did'nt find an answer.

Any hints?


R 1.8.1.
Windows
Cand. Polit.
Niels Steen Krogh
Solsortvej 44
2000 F.

Tlf: 3888 8613

ZiteLab / EmpoweR youR data with R, Zope and SOAP




More information about the R-help mailing list