interval: Prediction and Confidence Intervals for glm Objects

Description Usage Arguments Value Author(s) Examples

View source: R/interval.R

Description

Prediction and Confidence Intervals for glm Objects

Usage

1
2
3
4
5
interval(glm.object, ...)
## S3 method for class 'glm'
interval(glm.object, linkfit.object,
         type = c("link", "response"),
         conf.level = 0.95, ...)

Arguments

glm.object

result from a call to the glm function.

linkfit.object

result from a call to the predict function for the glm.object with type="link", se.fit=TRUE.

type

Either "link" or "response". See predict.glm for details.

conf.level

Confidence level, for example .95 for 95%.

...

Other arguments to be passed to predict.glm.

Value

Matrix with five columns: fit, ci.low, ci.hi, pi.low, pi.hi and as many rows as predict.glm returns.

Author(s)

Richard M. Heiberger <[email protected]>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(spacshu)
spacshu.bin.glm <- glm(damage ~ tempF, data=spacshu, family=binomial)

## observed data
spacshu.interval          <- interval(spacshu.bin.glm)

## new data, link
spacshu.interval.link     <- interval(spacshu.bin.glm, newdata=data.frame(tempF=30:85))

## new data, response
spacshu.interval.response <- interval(spacshu.bin.glm, newdata=data.frame(tempF=30:85),
                                      type="response")

Example output

Loading required package: lattice
Loading required package: grid
Loading required package: latticeExtra
Loading required package: RColorBrewer
Loading required package: multcomp
Loading required package: mvtnorm
Loading required package: survival
Loading required package: TH.data
Loading required package: MASS

Attaching package: 'TH.data'

The following object is masked from 'package:MASS':

    geyser

Loading required package: gridExtra

HH documentation built on May 29, 2017, 7:49 p.m.

Related to interval in HH...