Confidence intervals for model parameters
Computes confidence intervals for one or more parameters in a fitted model, based on the profiles of a specified objective.
confintModel(fitted, quantile = qchisq(0.95, 1), verbose = TRUE, endpoint.tolerance = 1e-3, max.zoom = 100, zero.bound = 1e-08, stepsize = 0.5, stdn = 5, gridsize = 20, scale = FALSE, which = 1:length(coef(fitted)), objective = stop("'objective' is missing."), agreement = TRUE, method = "smooth", n.interpolations = 100, ...) ## S3 method for class 'profileModel' profConfint(prof, method = "smooth", endpoint.tolerance = 1e-3, max.zoom = 100, n.interpolations = 100, verbose = FALSE, ...) ## S3 method for class 'profileModel' profZoom(prof, max.zoom = 100, endpoint.tolerance = 1e-03, verbose = FALSE, ...) ## S3 method for class 'profileModel' profSmooth(prof, n.interpolations = 100, ...)
fitted |
a |
prof |
a |
quantile |
The quantile to be used for the construction of the confidence intervals. The default is qchisq(0.95, 1). |
verbose |
if |
endpoint.tolerance |
the tolerance on the absolute difference of the value of the profile at the endpoints from the quantile used. Only relevant when confidence intervals are constructed via the "profZoom" method (see Details). |
max.zoom |
the maximum number of iterations that the binary
search algorithm will take towards the achievement of
|
zero.bound |
same as in |
stepsize |
same as in |
stdn |
same as in |
gridsize |
same as in |
scale |
same as in |
which |
for which parameters should the confidence intervals be calculated? |
objective |
same as in |
agreement |
same as in |
method |
the method to be used for the calculation of the confidence intervals. Possible values are "smooth", which is the default, and "zoom" (see Details). |
n.interpolations |
if
|
... |
for
|
The confidence intervals methods refer to convex objectives. Objectives that result in disjoint confidence regions are not currently supported.
When the profile object is available and was called with the
specification of the appropriate quantile then
profConfint
should be used. confintModel
applies directly to the fitted model and calls profileModel
.
When method="zoom"
the profZoom
method is applied to the
"profileModel"
object. When method="smooth"
the
profSmooth
method is applied to the "profileModel"
object.
The profZoom
method relies on a binary search and can find the
endpoints of the confidence intervals for a pre-specified tolerance
for the absolute difference of the value of the profile at each endpoint
from the quantile used. It is a computationally intensive method and is
useful in cases where the estimate is infinite and in coverage related
simulations.
The profSmooth
method, fits a smoothing spline on the points
specified by the "profileModel"
object and then interpolates the
endpoints of the confidence intervals at the specified
quantile
. It is much faster than profZoom
and can safely
be used in cases where the profiled objective is nearly quadratic in
shape, but could be misleading otherwise.
Both methods can report an infinite endpoint. The detection is based on the
intersects
component of the "profileModel"
object.
profConfint
is a wrapper method that collects the capabilities
of profZoom
and profSmooth
.
profSmooth
, profZoom
and profConfint
use the
quantile that comes with the "profileModel"
object prof
.
All the functions return a matrix with columns the endpoints of the confidence intervals for the specified (or profiled) parameters.
Additionally, confintModel
and profConfint
have
an attribute carrying the name of the fitted object and the name of the
"profileModel"
object, respectively.
Ioannis Kosmidis <email: ioannis.kosmidis@warwick.ac.uk>
## Not run: ## Begin Example: quasi likelihood estimation. ## Incidence of leaf-blotch on barley ## McCullagh and Nelder (1989), pp. 328--332 library(gnm) data(barley) logitModel <- glm(y ~ site + variety, family = wedderburn, data = barley) profQuasi <- profileModel(logitModel, objective = "ordinaryDeviance", quantile=qchisq(0.95, 1), which = paste("variety",c(2:9,"X"),sep="")) # very accurate confidence intervals (with endpoints accurate up to 10 # decimals) for the variety parameters using profConfint with # method="zoom": c1 <- profConfint(profQuasi, endpoint.tolerance = 1e-10, maxit = 100, method="zoom" ) # confidence intervals using smoothing: c2 <- profConfint(profQuasi, method="smooth" ) # c2 has accurate endpoints at least up to four decimals # this is because of the quadratic shape of the profiles plot(profQuasi, cis = c1) plot(profQuasi, cis = c1, signed = TRUE, print.grid.points = TRUE) # pairs plot pairs(profQuasi) # Notice the direction of the pairs plots. The fact that the # correlations among the estimates are 1/2 is clear. # profiling using the Rao score statistic # This can be used as deviance in cases were a quasi likelihood does not # exist. profRao <- update(profQuasi, objective = "RaoScoreStatistic", X = model.matrix(logitModel)) ## End Example ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.