This function computes the model-averaged predictions, unconditional
standard errors, and confidence intervals based on the entire candidate
model set. The function is currently implemented for glm
,
gls
, lm
, lme
, mer
, merMod
,
lmerModLmerTest
, negbin
, rlm
, survreg
object
classes that are stored in a list as well as various models of
unmarkedFit
classes.
modavgPred(cand.set, modnames = NULL, newdata, second.ord = TRUE,
nobs = NULL, uncond.se = "revised", conf.level = 0.95, ...)# S3 method for AICaov.lm
modavgPred(cand.set, modnames = NULL, newdata,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
# S3 method for AICglm.lm
modavgPred(cand.set, modnames = NULL, newdata,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
gamdisp = NULL, ...)
# S3 method for AIClm
modavgPred(cand.set, modnames = NULL, newdata,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
# S3 method for AICgls
modavgPred(cand.set, modnames = NULL, newdata,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
# S3 method for AIClme
modavgPred(cand.set, modnames = NULL, newdata,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
# S3 method for AICmer
modavgPred(cand.set, modnames = NULL, newdata,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1, ...)
# S3 method for AICglmerMod
modavgPred(cand.set, modnames = NULL, newdata,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1, ...)
# S3 method for AIClmerMod
modavgPred(cand.set, modnames = NULL, newdata,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
# S3 method for AIClmerModLmerTest
modavgPred(cand.set, modnames = NULL, newdata,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
# S3 method for AICnegbin.glm.lm
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", ...)
# S3 method for AICrlm.lm
modavgPred(cand.set, modnames = NULL, newdata,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
# S3 method for AICsurvreg
modavgPred(cand.set, modnames = NULL, newdata,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", ...)
# S3 method for AICunmarkedFitOccu
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitColExt
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitOccuRN
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitPCount
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitPCO
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitDS
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitGDS
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitOccuFP
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitMPois
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitGMM
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitGPC
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitOccuTTD
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitMMO
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitDSO
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitOccuMS
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitOccuMulti
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitGOccu
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
# S3 method for AICunmarkedFitOccuComm
modavgPred(cand.set, modnames = NULL,
newdata, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, type = "response", c.hat = 1,
parm.type = NULL, ...)
modavgPred
returns an object of class modavgPred
with the
following components:
the scale of predicted values (response or link) for glm
, mer
,
merMod
, or unmarkedFit
classes.
the model-averaged prediction over the entire candidate model set.
the unconditional standard error of each model-averaged prediction.
the confidence level used to compute the confidence interval.
the lower confidence limit.
the upper confidence limit.
a matrix with rows consisting of the model-averaged predictions, the unconditional standard errors, and the confidence limits.
a list storing each of the models in the candidate model set.
a character vector of model names to facilitate the identification of
each model in the model selection table. If NULL
, the function
uses the names in the cand.set list of candidate models. If no names
appear in the list, generic names (e.g., Mod1
, Mod2
) are
supplied in the table in the same order as in the list of candidate
models.
a data frame with the same structure as that of the original data frame
for which we want to make predictions. For community occupancy models
of unmarkedFitOccuComm
classes, the newdata
data frame
must include a column specifying the name of the species for which each
prediction is requested (see 'Examples' below).
logical. If TRUE
, the function returns the second-order
Akaike information criterion (i.e., AICc).
this argument allows to specify a numeric value other than total
sample size to compute the AICc (i.e., nobs
defaults to total
number of observations). This is relevant only for mixed models or
various models of unmarkedFit
classes where sample size is not
straightforward. In such cases, one might use total number of
observations or number of independent clusters (e.g., sites) as the
value of nobs
.
either, old
, or revised
, specifying the
equation used to compute the unconditional standard error of a
model-averaged estimate. With uncond.se = "old"
,
computations are based on equation 4.9 of Burnham and Anderson
(2002), which was the former way to compute unconditional standard
errors. With uncond.se = "revised"
, equation 6.12 of Burnham
and Anderson (2002) is used. Anderson (2008, p. 111) recommends use
of the revised version for the computation of unconditional standard
errors and it is now the default. Note that versions of package
AICcmodavg < 1.04 used the old method to compute unconditional
standard errors.
the confidence level (\(1 - \alpha\)) requested for the computation of unconditional confidence intervals.
the scale of prediction requested, one of response
or
link
. The latter is only relevant for glm
, mer
,
and unmarkedFit
classes. Note that the value terms
is not
defined for modavgPred
.
value of overdispersion parameter (i.e., variance inflation factor) such
as that obtained from c_hat
. Note that values of c.hat
different from 1 are only appropriate for binomial GLM's with trials > 1
(i.e., success/trial or cbind(success, failure) syntax), with Poisson
GLM's, single-season and dynamic occupancy models (MacKenzie et
al. 2002, 2003), or N-mixture models (Royle 2004, Dail and Madsen
2011). If c.hat > 1
, modavgPred
will return the
quasi-likelihood analogue of the information criteria requested and
multiply the variance-covariance matrix of the estimates by this value
(i.e., SE's are multiplied by sqrt(c.hat)
). This option is not
supported for generalized linear mixed models of the mer
class.
the value of the gamma dispersion parameter.
this argument specifies the parameter type on which
the predictions will be computed and is only relevant for models of
unmarkedFit
classes. The character strings supported vary with
the type of model fitted. For unmarkedFitOccu
, unmarkedFitOccuMulti
, and
unmarkedFitOccuComm
objects, either psi
or detect
can be supplied to indicate whether the parameter is on occupancy or
detectability, respectively. For unmarkedFitColExt
objects,
possible values are psi
, gamma
, epsilon
, and
detect
, for parameters on occupancy in the inital year,
colonization, extinction, and detectability, respectively. For
unmarkedFitOccuTTD
objects, possible values are psi
,
gamma
, epsilon
, and detect
, for parameters on
occupancy in the inital year, colonization, extinction, and
time-to-dection (lambda rate parameter), respectively. For
unmarkedFitOccuFP
objects, one can specify psi
,
detect
, falsepos
, and certain
, for occupancy,
detectability, probability of assigning false-positives, and
probability detections are certain, respectively. For
unmarkedFitOccuRN
objects, either lambda
or
detect
can be entered for abundance and detectability
parameters, respectively. For unmarkedFitPCount
and
unmarkedFitMPois
objects, lambda
or detect
denote
parameters on abundance and detectability, respectively. For
unmarkedFitPCO
, unmarkedFitMMO
, and
unmarkedFitDSO
objects, one can enter lambda
,
gamma
, omega
, iota
, or detect
, to specify
parameters on abundance, recruitment, apparent survival, immigration,
and detectability, respectively. For unmarkedFitDS
objects,
lambda
and detect
are supported. For
unmarkedFitGDS
, lambda
, phi
, and detect
denote abundance, availability, and detection probability,
respectively. For unmarkedFitGMM
and unmarkedFitGPC
objects, lambda
, phi
, and detect
denote
abundance, availability, and detectability, respectively. For
unmarkedFitOccuMS
objects, psi
, phi
, and
detect
denote occupancy, transition, and detection probability,
respectively. For unmarkedFitGOccu
objects, possible values
are psi
, phi
, or detect
, denoting occupancy,
availability, and detection probabilities, respectively.
additional arguments passed to the function.
Marc J. Mazerolle
The candidate models must be stored in a list. Note that a data frame
from which to make predictions must be supplied with the newdata
argument and that all variables appearing in the model set must appear
in this data frame. Variables must be of the same type as in the
original analysis (e.g., factor, numeric).
One can compute unconditional confidence intervals around the
predictions from the elements returned by modavgPred
. The
classic computation based on asymptotic normality of the estimator is
appropriate to estimate confidence intervals on the linear predictor
(i.e., link scale). For predictions of some types of response
variables such as counts or binary variables, the normal approximation
may be inappropriate. In such cases, it is often better to compute
the confidence intervals on the linear predictor scale and then
back-transform the limits to the scale of the response variable.
These are the confidence intervals returned by modavgPred
.
Burnham et al. (1987), Burnham and Anderson (2002, p. 164), and
Williams et al. (2002) suggest alternative methods of computing
confidence intervals for small degrees of freedom with profile
likelihood intervals or bootstrapping, but these approaches are not
yet implemented in modavgPred
.
Anderson, D. R. (2008) Model-based Inference in the Life Sciences: a primer on evidence. Springer: New York.
Burnham, K. P., Anderson, D. R., White, G. C., Brownie, C., Pollock, K. H. (1987) Design and analysis methods for fish survival experiments based on release-recapture. American Fisheries Society Monographs 5, 1--437.
Burnham, K. P., Anderson, D. R. (2002) Model Selection and Multimodel Inference: a practical information-theoretic approach. Second edition. Springer: New York.
Dail, D., Madsen, L. (2011) Models for estimating abundance from repeated counts of an open population. Biometrics 67, 577--587.
MacKenzie, D. I., Nichols, J. D., Lachman, G. B., Droege, S., Royle, J. A., Langtimm, C. A. (2002) Estimating site occupancy rates when detection probabilities are less than one. Ecology 83, 2248--2255.
MacKenzie, D. I., Nichols, J. D., Hines, J. E., Knutson, M. G., Franklin, A. B. (2003) Estimating site occupancy, colonization, and local extinction when a species is detected imperfectly. Ecology 84, 2200--2207.
Royle, J. A. (2004) N-mixture models for estimating population size from spatially replicated counts. Biometrics 60, 108--115.
Williams, B. K., Nichols, J. D., Conroy, M. J. (2002) Analysis and Management of Animal Populations. Academic Press: New York.
AICc
, aictab
, importance
,
c_hat
, confset
, evidence
,
modavg
, modavgCustom
,
modavgEffect
, modavgShrink
,
predict
, predictSE