The R package "MuMIn" (multi-model inference) contains a function 'dredge' that can be used to easily generate a set of models that contains all possible combinations of the terms in a user-specified global model. It can be applied in RMark as shown in 2 basic examples below. One example uses the mallard nest-survival dataset that is available in RMark. The other works with the dipper dataset. The help for "MuMIn" provides further details about using the function, setting various options for constraining the model combinations to evaluate, and what information criterion to use.
#################################
# Example with nest survival models #
library(RMark)
library(MuMIn)
data(mallard)
Big.Mod=mark(mallard,nocc=90,model="Nest",
model.parameters=list(S=list(formula=~NestAge+Robel+PpnGrass)))
mods=dredge(Big.Mod)
mods
print(mods, abbrev.names=FALSE)
print.data.frame(mods,digits=7,na.print = "", abbrev.names = FALSE)
coeffs(mods)
################################
# Dipper example #
require(RMark)
require(MuMIn)
data(dipper)
# Process data
dipper.processed=process.data(dipper,groups=("sex"))
# Create default design data
dipper.ddl=make.design.data(dipper.processed)
# Add Flood covariates for Phi and p that have different values
dipper.ddl$Phi$Flood=0
dipper.ddl$Phi$Flood[dipper.ddl$Phi$time==2 | dipper.ddl$Phi$time==3]=1
dipper.ddl$p$Flood=0
dipper.ddl$p$Flood[dipper.ddl$p$time==3]=1
Phidot=list(formula=~1)
Phitime=list(formula=~time)
PhiFlood=list(formula=~Flood)
# Define range of models for p
pdot=list(formula=~1)
ptime=list(formula=~time)
gen=mark(dipper.processed,dipper.ddl,
model.parameters=list(Phi=list(formula=~sex*time),p=list(formula=~Flood)))
mods=dredge(gen)
mods
coeffs(mods)