Learn R Programming

GLMpack (version 0.1.0)

glm.cis: Compute confidence intervals for predictions.

Description

Apply an exponential transformation to the confidence intervals and predictions from binomial and Poisson models.

Usage

glm.cis(preds, ses, alpha, df)

Arguments

preds

The predictions based on the additive linear component of the model.

ses

The standard error(s) of the prediction.

alpha

The desired confidence level.

df

The desired degrees of freedom.

Value

The output is a matrix.

Examples

Run this code
# NOT RUN {
data(campaign)
attach(campaign)
cmpgn.out <- glm(TOTCONTR ~ CANDGENDER + PARTY + INCUMCHALL + HISPPCT,
                 family=Gamma(link = 'log'), data=campaign)
newdat_gender <- data.frame(CANDGENDER = c('F','M'), PARTY= rep('Democrat',2),
                            INCUMCHALL=rep("C", 2), HISPPCT=rep(mean(campaign$HISPPCT),2))
preds_gender <- predict(cmpgn.out, newdata = newdat_gender, se.fit = TRUE)
glm.cis(preds_gender$fit, preds_gender$se.fit, 0.95,cmpgn.out$df.residual)

# }

Run the code above in your browser using DataLab