HI Richard,
I am learning unmarked for the single season occupancy model case and
wanted to ask a couple of questions about model averaging. Bill
Deluca has been helping with code, but I wanted to double check to
make sure I understand the calculations fully.
We have run several models and used the fitList function and modSel
function to do model comparison:
fits <- fitList(Null = m1, m2 = m2, m3 = m3, m4 = m4)
(ms.wp <- modSel(fits, nullmod='Null'))
To get the model averaged parameter estimates, we extract the
information and coefficients from the models using
allInfo <- ms.wp@Full #extracts info from model selection object
coefs <- coef(ms.wp) #extracts coefficient estimates
coefs[
is.na(coefs)] <- 0 #sets parameters to 0 that were not included
in a model.
wt <- allInfo$AICwt #extracts AIC wt from allInfo
colSums(coefs * wt) #multiplies coefs by wt and summarizes by
column
I just want to make sure I understand exactly what this computation is
doing. If a model does not contain a parameter (for example,
elevation), this code sets that estimate to 0. Then each model in the
model set contains an estimate for the covariate....those models that
did not contain the covariate were set to 0. Then each estimate is
multiplied by the model weight to provide the model averaged
estimate? This makes sense to me but I wanted to clarify because
there seems to be more than one way to model average. For instance,
some folks will include only those models where the covariate was
included in the model, and then rescale the weights so that they add
to 1 (so that models that do not include the covariate are not used in
the model averaging equation).
Also, can you help me with the code used to estimate the standard
errors for a model averaged estimate? Thank you for your
consideration.