I am trying to perform prediction using R with confidence interval:
mod <- glm(y ~ x, data = foo, family = binomial)
preddata <- with(foo, data.frame(x = seq(min(x), max(x), length = 100))
preds <- predict(mod, newdata = preddata, type = "link", se.fit = TRUE)
critval <- 1.96
upr <- preds$fit + (critval * preds$se.fit)
lwr <- preds$fit - (critval * preds$se.fit)
fit <- preds$fit
I am trying to understand why are we multiplying preds$sef.fit by 1.96? Can somebody explain to me the importance of 1.96, please?