I have read from here and understand how to calculate the estimated logit from a fitted logistic regression model, but how to work on the confidence interval? As it involved a variance-covariance matrix and I think it is better to have a program to do the calculation, rather then doing it by myself.
Thanks.
Edit 01
I have added a script here:
chdage.dummy <- data.frame(chd=c(rep(1,50),rep(0,50)),
race=c(rep("white",5),rep("black",20),rep("hispanic",15),rep("other",10),
rep("white",20),rep("black",10),rep("hispanic",10),rep("other",10)),
stringsAsFactors=FALSE)
chdage.dummy[,"race"] <- factor(chdage.dummy[,"race"],levels=c("white","black","hispanic","other"))
chdage.lr.02 <- glm(chd~race,data=chdage.dummy,family="binomial")
predict(chdage.lr.02,newdata=data.frame(race="white"))
predict function can give me an estimate, but I can't use confint outside predict, so what can I do?
confint? – MYaseen208 Jan 10 '12 at 3:18se.fitoption inpredict(). A confidence intervals can be constructed around each fitted logit is given by taking the fitting logit value +- 1.96 * the corresponding estimated standard error. Alternatively, use matrix algebra, and construct confidence intervals for the fitted logits, by treating them as linear combinations of the estimated coefficients, returned by e.g.coef(chdage.lr.o2). (The former method is likely easier) – guest Jan 10 '12 at 7:14se.fit? Thanks. – lokheart Jan 10 '12 at 7:17