Learn R Programming

ellipse (version 0.2-3)

ellipse.glm: Outline an approximate pairwise confidence region

Description

This function produces the ellipsoidal outline of an approximate pairwise confidence region for a generalized linear model fit.

Usage

## S3 method for class 'glm':
ellipse(x, which = c(1, 2), level = 0.95, t, ...)

Arguments

x
The first argument should be a glm object, usually resulting from a call to glm().
which
Which selects the pair of parameters to be plotted. The default is the first two.
level
The confidence level of the region. Default 95%.
t
The t statistic on the boundary of the ellipse. For Binomial or Poisson families, sqrt(qchisq(level, 2)) is used; for other distributions, sqrt(2*qf(level, 2, df)) where df is the residual degrees of freedom.
...
Other ellipse.default parameters may also be used.

Value

  • A matrix with columns named according to which to outline the confidence region.

Details

The summary function is used to obtain the approximate covariance matrix of the fitted parameters, the dispersion estimate, and the degrees of freedom.

See Also

ellipse.default

Examples

Run this code
# Plot an approximate 95 % confidence region for the TreatCont and TreatFT 
# coefficients for the MASS anorexia data

library(MASS)
data(anorexia)

fit <- glm(Postwt ~ Prewt + Treat + offset(Prewt),
                       family = gaussian, data = anorexia)
plot(ellipse(fit, which = c('TreatCont', 'TreatFT')), type = 'l')
points(fit$coefficients['TreatCont'], fit$coefficients['TreatFT'])

Run the code above in your browser using DataLab