Compute Modelaveraged Parameter Estimate with Shrinkage (Multimodel Inference)
Description
This function computes an alternative version of modelaveraging
parameter estimates that consists in shrinking estimates toward 0 to
reduce model selection bias as in Burnham and Anderson (2002, p. 152),
Anderson (2008, pp. 130132) and Lukacs et al. (2010). Specifically,
models without the parameter of interest have an estimate and variance
of 0. modavgShrink
also returns unconditional standard errors
and unconditional confidence intervals as described in Buckland et
al. (1997) and Burnham and Anderson (2002).
Usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163  modavgShrink(cand.set, parm, modnames = NULL, second.ord = TRUE,
nobs = NULL, uncond.se = "revised", conf.level = 0.95,
...)
## S3 method for class 'AICaov.lm'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AICbetareg'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AICsclm.clm'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AICclmm'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AICcoxph'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AICglm.lm'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, gamdisp = NULL, ...)
## S3 method for class 'AICgls'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AIChurdle'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AIClm'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AIClme'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AIClmekin'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AICmer'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AICglmerMod'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AIClmerMod'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AICmaxlikeFit.list'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, ...)
## S3 method for class 'AICmultinom.nnet'
modavgShrink(cand.set, parm, modnames =
NULL, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, ...)
## S3 method for class 'AICpolr'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AICrlm.lm'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AICsurvreg'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AICvglm'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, ...)
## S3 method for class 'AICzeroinfl'
modavgShrink(cand.set, parm, modnames = NULL,
second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, ...)
## S3 method for class 'AICunmarkedFitOccu'
modavgShrink(cand.set, parm, modnames =
NULL, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, parm.type = NULL, ...)
## S3 method for class 'AICunmarkedFitColExt'
modavgShrink(cand.set, parm, modnames
= NULL, second.ord = TRUE, nobs = NULL, uncond.se =
"revised", conf.level = 0.95, c.hat = 1, parm.type = NULL,
...)
## S3 method for class 'AICunmarkedFitOccuRN'
modavgShrink(cand.set, parm, modnames
= NULL, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, parm.type = NULL, ...)
## S3 method for class 'AICunmarkedFitPCount'
modavgShrink(cand.set, parm, modnames
= NULL, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, parm.type = NULL, ...)
## S3 method for class 'AICunmarkedFitPCO'
modavgShrink(cand.set, parm, modnames =
NULL, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, parm.type = NULL, ...)
## S3 method for class 'AICunmarkedFitDS'
modavgShrink(cand.set, parm, modnames =
NULL, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, parm.type = NULL, ...)
## S3 method for class 'AICunmarkedFitGDS'
modavgShrink(cand.set, parm, modnames =
NULL, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, parm.type = NULL, ...)
## S3 method for class 'AICunmarkedFitOccuFP'
modavgShrink(cand.set, parm, modnames
= NULL, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, parm.type = NULL, ...)
## S3 method for class 'AICunmarkedFitMPois'
modavgShrink(cand.set, parm, modnames
= NULL, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, parm.type = NULL, ...)
## S3 method for class 'AICunmarkedFitGMM'
modavgShrink(cand.set, parm, modnames
= NULL, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, parm.type = NULL, ...)
## S3 method for class 'AICunmarkedFitGPC'
modavgShrink(cand.set, parm, modnames
= NULL, second.ord = TRUE, nobs = NULL, uncond.se = "revised",
conf.level = 0.95, c.hat = 1, parm.type = NULL, ...)

Arguments
cand.set 
a list storing each of the models in the candidate model set. 
parm 
the parameter of interest, enclosed between quotes, for which a modelaveraged estimate is required. For a categorical variable, the label of the estimate must be included as it appears in the output (see 'Details' below). 
modnames 
a character vector of model names to facilitate the identification of
each model in the model selection table. If 
second.ord 
logical. If 
nobs 
this argument allows to specify a numeric value other than total
sample size to compute the AICc (i.e., 
uncond.se 
either, 
conf.level 
the confidence level (1  α) requested for the computation of unconditional confidence intervals. 
c.hat 
value of overdispersion parameter (i.e., variance inflation factor) such
as that obtained from 
gamdisp 
if gamma GLM is used, the dispersion parameter should be specified here to apply the same value to each model. 
parm.type 
this argument specifies the parameter type on which the effect size
will be computed and is only relevant for models of

... 
additional arguments passed to the function. 
Details
The parameter for which a modelaveraged estimate is requested must be
specified with the parm
argument and must be identical to its
label in the model output (e.g., from summary
). For factors, one
must specify the name of the variable and the level of interest. The
shrinkage version of model averaging is only appropriate for cases where
each parameter is given an equal weighting in the model (i.e., each
parameter must appear the same number of times in the models) and has
the same interpretation across all models. As a result, models with
interaction terms or polynomial terms are not supported by
modavgShrink
.
modavgShrink
is implemented for a list containing objects of
aov
, betareg
, clm
, clmm
, clogit
,
coxme
, coxph
, glm
, gls
, hurdle
,
lm
, lme
, lmekin
, maxlikeFit
, mer
,
glmerMod
, lmerMod
, multinom
, polr
,
rlm
, survreg
, vglm
, zeroinfl
classes as well
as various models of unmarkedFit
classes.
Value
modavgShrink
creates an object of class modavgShrink
with the following components:
Parameter 
the parameter for which a modelaveraged estimate with shrinkage was obtained 
Mod.avg.table 
the model selection table based on models including the parameter of interest 
Mod.avg.beta 
the modelaveraged estimate based on all models 
Uncond.SE 
the unconditional standard error for the modelaveraged estimate (as opposed to the conditional SE based on a single model) 
Conf.level 
the confidence level used to compute the confidence interval 
Lower.CL 
the lower confidence limit 
Upper.CL 
the upper confidence limit 
Author(s)
Marc J. Mazerolle
References
Anderson, D. R. (2008) Modelbased Inference in the Life Sciences: a primer on evidence. Springer: New York.
Buckland, S. T., Burnham, K. P., Augustin, N. H. (1997) Model selection: an integral part of inference. Biometrics 53, 603–618.
Burnham, K. P., Anderson, D. R. (2002) Model Selection and Multimodel Inference: a practical informationtheoretic approach. Second edition. Springer: New York.
Burnham, K. P., Anderson, D. R. (2004) Multimodel inference: understanding AIC and BIC in model selection. Sociological Methods and Research 33, 261–304.
Dail, D., Madsen, L. (2011) Models for estimating abundance from repeated counts of an open population. Biometrics 67, 577–587.
Lukacs, P. M., Burnham, K. P., Anderson, D. R. (2010) Model selection bias and Freedman's paradox. Annals of the Institute of Statistical Mathematics 62, 117–125.
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.
Mazerolle, M. J. (2006) Improving data analysis in herpetology: using Akaike's Information Criterion (AIC) to assess the strength of biological hypotheses. AmphibiaReptilia 27, 169–180.
Royle, J. A. (2004) Nmixture models for estimating population size from spatially replicated counts. Biometrics 60, 108–115.
See Also
AICc
, aictab
, c_hat
,
importance
, confset
, evidence
,
modavg
, modavgCustom
,
modavgPred
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116  ##cement example in Burnham and Anderson 2002
data(cement)
##setup same model set as in Table 3.2, p. 102
Cand.models < list( )
Cand.models[[1]] < lm(y ~ x1 + x2, data = cement)
Cand.models[[2]] < lm(y ~ x1 + x2 + x4, data = cement)
Cand.models[[3]] < lm(y ~ x1 + x2 + x3, data = cement)
Cand.models[[4]] < lm(y ~ x1 + x4, data = cement)
Cand.models[[5]] < lm(y ~ x1 + x3 + x4, data = cement)
Cand.models[[6]] < lm(y ~ x2 + x3 + x4, data = cement)
Cand.models[[7]] < lm(y ~ x1 + x2 + x3 + x4, data = cement)
Cand.models[[8]] < lm(y ~ x3 + x4, data = cement)
Cand.models[[9]] < lm(y ~ x2 + x3, data = cement)
Cand.models[[10]] < lm(y ~ x4, data = cement)
Cand.models[[11]] < lm(y ~ x2, data = cement)
Cand.models[[12]] < lm(y ~ x2 + x4, data = cement)
Cand.models[[13]] < lm(y ~ x1, data = cement)
Cand.models[[14]] < lm(y ~ x1 + x3, data = cement)
Cand.models[[15]] < lm(y ~ x3, data = cement)
##vector of model names
Modnames < paste("mod", 1:15, sep="")
##AICc
aictab(cand.set = Cand.models, modnames = Modnames)
##compute modelaveraged estimate with shrinkage  each parameter
##appears 8 times in the models
modavgShrink(cand.set = Cand.models, modnames = Modnames, parm = "x1")
##compare against classic modelaveraging
modavg(cand.set = Cand.models, modnames = Modnames, parm = "x1")
##note that modelaveraged estimate with shrinkage is closer to 0 than
##with the classic version
##remove a few models from the set and run again
Cand.unbalanced < Cand.models[c(3, 14, 15)]
##set up model names
Modnames < paste("mod", 1:length(Cand.unbalanced), sep="")
##issues an error because some parameters appear more often than others
## Not run: modavgShrink(cand.set = Cand.unbalanced,
modnames = Modnames, parm = "x1")
## End(Not run)
##example on Orthodont data set in nlme
## Not run:
require(nlme)
##set up candidate model list
##age and sex parameters appear in the same number of models
##same number of models with and without these parameters
Cand.models < list( )
Cand.models[[1]] < lme(distance ~ age, data = Orthodont, method = "ML")
##random is ~ age  Subject as it is a grouped data frame
Cand.models[[2]] < lme(distance ~ age + Sex, data = Orthodont,
random = ~ 1, method = "ML")
Cand.models[[3]] < lme(distance ~ 1, data = Orthodont, random = ~ 1,
method = "ML")
Cand.models[[4]] < lme(distance ~ Sex, data = Orthodont, random = ~ 1,
method = "ML")
##create a vector of model names
Modnames < paste("mod", 1:length(Cand.models), sep = "")
##compute importance values for age
imp.age < importance(cand.set = Cand.models, parm = "age",
modnames = Modnames, second.ord = TRUE,
nobs = NULL)
##compute shrinkage version of model averaging on age
mod.avg.age.shrink < modavgShrink(cand.set = Cand.models,
parm = "age", modnames = Modnames,
second.ord = TRUE, nobs = NULL)
##compute classic version of model averaging on age
mod.avg.age.classic < modavg(cand.set = Cand.models, parm = "age",
modnames = Modnames, second.ord = TRUE,
nobs = NULL)
##correspondence between shrinkage version and classic version of
##model averaging
mod.avg.age.shrink$Mod.avg.beta/imp.age$w.plus
mod.avg.age.classic$Mod.avg.beta
detach(package:nlme)
## End(Not run)
##example of Nmixture model modified from ?pcount
## Not run:
require(unmarked)
data(mallard)
mallardUMF < unmarkedFramePCount(mallard.y, siteCovs = mallard.site,
obsCovs = mallard.obs)
##set up models so that each variable on abundance appears twice
fm.mall.one < pcount(~ ivel + date ~ length + forest, mallardUMF,
K = 30)
fm.mall.two < pcount(~ ivel + date ~ elev + forest, mallardUMF,
K = 30)
fm.mall.three < pcount(~ ivel + date ~ length + elev, mallardUMF,
K = 30)
##model list and names
Cands < list(fm.mall.one, fm.mall.two, fm.mall.three)
Modnames < c("length + forest", "elev + forest", "length + elev")
##compute modelaveraged estimate with shrinkage for elev on abundance
modavgShrink(cand.set = Cands, modnames = Modnames, parm = "elev",
parm.type = "lambda")
detach(package:unmarked)
## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.