Outline an approximate pairwise confidence region
ellipse.glm.Rd
This function produces the ellipsoidal outline of an approximate pairwise confidence region for a generalized linear model fit.
Arguments
- x
The first argument should be a
glm
object, usually resulting from a call toglm()
.- 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))
wheredf
is the residual degrees of freedom.- npoints
How many points to return in the ellipse.
- dispersion
The value of dispersion to use. If specified, it is treated as fixed, and the chi-square limits for
t
are used. If missing, it is taken fromsummary(x)
.- ...
Other
ellipse.default
parameters may also be used.
Details
The summary function is used to obtain the approximate covariance matrix of the fitted parameters, the dispersion estimate, and the degrees of freedom.
Examples
## Dobson (1990) Page 93: Randomized Controlled Trial :
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
glm.D93 <- glm(counts ~ outcome + treatment, family=poisson())
# Plot an approximate 95 % confidence region for the two Outcome parameters
plot(ellipse(glm.D93, which = c(2,3)), type = 'l')
points(glm.D93$coefficients[2], glm.D93$coefficients[3])