glm.cis: Compute confidence intervals for predictions.

Description Usage Arguments Value Examples

View source: R/glm.cis.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
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)

GLMpack documentation built on July 19, 2019, 5:05 p.m.

Related to glm.cis in GLMpack...