Page 1 of 1

Creating "all combinations" candidate set

PostPosted: Sun Jan 27, 2013 11:03 pm
by Tony G
I recently read the paper by Doherty, White and Burnham 2012 "Comparison of model Building and selection strategies Journal of Ornithology", who conclude that a "all possible combinations" strategy be used when selecting variables (i.e. cumulative AIC weights).

Is it possible to create a model list for all combinations in RMark using the mark.wrapper function? I have six model parameters for a standard CJS and have experimented with listing single parameters but I am unclear if how mark.wrapper handles models with multiple additive or interactive parameters.

Regards
Tony
Darwin, Australia

Re: Creating "all combinations" candidate set

PostPosted: Sun Jan 27, 2013 11:15 pm
by cooch
Tony G wrote:I recently read the paper by Doherty, White and Burnham 2012 "Comparison of model Building and selection strategies Journal of Ornithology", who conclude that a "all possible combinations" strategy be used when selecting variables (i.e. cumulative AIC weights).

Is it possible to create a model list for all combinations in RMark using the mark.wrapper function? I have six model parameters for a standard CJS and have experimented with listing single parameters but I am unclear if how mark.wrapper handles models with multiple additive or interactive parameters.

Regards
Tony
Darwin, Australia


The 'all subsets' approach is in fact a coded option in MARK - see section 6.5.1 in Chapter 6 of the MARK book:

http://www.phidot.org/software/mark/doc ... /chap6.pdf

I'll leave it to Jeff to explain how he has wrapped that in RMark.

Re: Creating "all combinations" candidate set

PostPosted: Mon Jan 28, 2013 12:11 am
by jlaake
Tony-

create.model.list creates all combinations across parameters (eg Phi,p) for the formulas that you specify but does not create all possible formulas for a set of variables to be used for a parameter. What you are describing has been a topic of discussion on the R list server on occasion and if you look around I'm sure you'll find come code that will create all possible formula. If you can't find any get back to me and I'll look around in my code. I wrote some awhile back for a student and I can probably find it. Be careful. If you have 6 variables that is 2^6=64 just for the one parameter without interactions. If you did that with another parameter then you would be fitting 64^2 models.

--jeff

Re: Creating "all combinations" candidate set

PostPosted: Mon Jan 28, 2013 1:31 am
by Tony G
Evan and Jeff,

Thanks - I've now RTFM :oops: and will decide if this approach is warranted.

Regards
Tony

Re: Creating "all combinations" candidate set

PostPosted: Mon Jan 28, 2013 9:57 am
by bacollier
Tony,
Not judging whether its a good idea in your case or not, here is some code that I used for a 2 species occupancy model to run a specific set of all combinations based on a set of parameter specific models (not individual parameters) in RMark. The trick is to number each of your models xxxx.1, xxxx.2, etc., then create.model.list() will build all the relationships at the model level.

Bret

Code: Select all
gwbv.fun=function()
{
#Process GCWA dataset for analysis
x=process.data(x, model="2SpecConOccup")
x.ddl=make.design.data(x)

###############
#Model Parameter Definitions
#PsiA      Probability of occupancy for species A
#PsiBA     Probability of occupancy for species B, given species A is present
#PsiBa     Probability of occupancy for species B, given species A is absent
#pA     Probability of detection for species A, given species B is absent
#pB     Probability of detection for species B, given species A is absent
#rA     Probability of detection for species A, given both species are present
#rBA     Probability of detection for species B, given both species are present and species A is detected
#rBa     Probability of detection for species B, given both species are present and species A is not detected
###############

#Occupancy-PsiA, PsiBA, PsiBa
PsiA.1=list(PsiA=list(formula=~chm + ccm), PsiBA=list(formula=~chm), PsiBa=list(formula=~chm))
PsiA.2=list(PsiA=list(formula=~chm*ccm), PsiBA=list(formula=~chm + ccm), PsiBa=list(formula=~chm + ccm))
PsiA.3=list(PsiA=list(formula=~chm + ccm), PsiBA=list(formula=~chm + ccm), PsiBa=list(formula=~chm))
PsiA.4=list(PsiA=list(formula=~chm*ccm), PsiBA=list(formula=~chm*ccm), PsiBa=list(formula=~chm))
PsiA.5=list(PsiA=list(formula=~chm + ccm), PsiBA=list(formula=~chm + chsd), PsiBa=list(formula=~chm + chsd))

#Detection-pA, pB
pA.1=list(pA=list(formula=~GWSD), pB=list(formula=~1))
pA.2=list(pA=list(formula=~1), pB=list(formula=~BVSD))
pA.3=list(pA=list(formula=~GWSD), pB=list(formula=~BVSD))

#Detection-rA, rBA, rBa
#rA
rA.1=list(formula=~GWSD + chm + ccm)
rA.2=list(formula=~GWSD + chm)

#rBA
rBA.1=list(formula=~BVSD + chm * ccm)
rBA.2=list(formula=~BVSD + chm  + ccm)
rBA.3=list(formula=~BVSD + chm)
rBA.4=list(formula=~BVSD + LSH + SCL)

#rBa
rBa.1=list(formula=~BVSD + chm)
rBa.2=list(formula=~BVSD + chm*ccm)
rBa.3=list(formula=~BVSD + chm + chsd)

#Candidate Model Set
my.models=create.model.list("2SpecConOccup")
my.results=mark.wrapper(my.models, data=x, ddl=x.ddl)

#Create model list
return(my.results)
}

my.results=gwbv.fun()