Sure if they have the same number of occasions and same time intervals they can be constructed as a above with a group covariate to model any regional effects. They can have different different begin times in that case as well as long as you include a covariate for groups and specify multiple begin.times (one for each group). That would be the standard thing to do. The non-overlap is when the number of occasions (secondary/primary structure as well) or the time intervals differ across regions. I believe that was the reason for your question and my suggestion
Thanks, Jeff. And yes, correct. I was initially looking for a solution when occasions didn't line up either. I suggested the idea above to ensure I understood how the structure worked.
I have simulated two sets of data with the following specifications:
GROUP1:
Initial Captures=25
Phi=0.85f=0.15
p=0.5
GROUP2:
Initial Captures=25
Phi=0.65f=0.15
p=0.5
The structure of these data are 5 primary sessions, each with 4 secondary sessions. Group 1 was sampled 2007,2010-2013, and Group 2 2006, 2010-2013.
I prefixed the ch for Group 1 with four 0's, "0000" to pad the ch where Group 2 was sampled in 2006, and I added four 0's, "0000" between the 2006 and 2010 captures for Group 2, to pad where Group 1 was sampled in 2007.
Overall the structure looks like this,(1's are added to show where I left the data as is and added 0's, the true ch's are not pure 1's)
Group 1: 000011111111111111111111
Group 2: 111100001111111111111111
Processing code looked as follows:
- Code: Select all
NEWDF.proc=process.data(NEWDF, model="RDPdfHuggins",groups=("Group"), begin.time=c(2006),time.intervals=c(0,0,0,1,0,0,0,3,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0))
I fixed parameters and ran mark model as follows:
- Code: Select all
###FIX PARAMETERS
##p
NEWDF.ddl$p$fix=NA
NEWDF.ddl$p$fix[NEWDF.ddl$p$group==1&NEWDF.ddl$p$time==2006]=0
NEWDF.ddl$p$fix[NEWDF.ddl$p$group==2&NEWDF.ddl$p$time==2007]=0
NEWDF.ddl$c$fix=NA
NEWDF.ddl$c$fix[NEWDF.ddl$c$group==1&NEWDF.ddl$c$time==2006]=0
NEWDF.ddl$c$fix[NEWDF.ddl$c$group==2&NEWDF.ddl$c$time==2007]=0
##Phi
NEWDF.ddl$Phi$fix=NA
NEWDF.ddl$Phi$fix[NEWDF.ddl$Phi$group==1&NEWDF.ddl$Phi$time==2006]=1
NEWDF.ddl$Phi$fix[NEWDF.ddl$Phi$group==2&NEWDF.ddl$Phi$time==2007]=1
NEWDF.ddl$f$fix=NA
NEWDF.ddl$f$fix[NEWDF.ddl$f$group==1&NEWDF.ddl$f$time==2006]=1
NEWDF.ddl$f$fix[NEWDF.ddl$f$group==2&NEWDF.ddl$f$time==2007]=0
##Model
NEWM1<-mark(data=NEWDF.proc,ddl=NEWDF.ddl,model.parameters = list(p=list(formula=~1,share=TRUE),
Phi=list(formula=~Group),
f=list(formula=~Group)),output=FALSE,model="RDPdfHuggins", delete=TRUE)
Results are as follows:
GROUP1:
Phi=0.92f=0.086
p=0.49
GROUP2:
Phi=0.71f=0.086
p=0.49
So pretty close to the expected values, and did quite well given small samples (25).
My main concern was whether I fixed Phi and f properly. Yes I got the expected results, but if I do:
- Code: Select all
NEWDF.ddl$f$fix[NEWDF.ddl$f$group==1&NEWDF.ddl$f$time==2006]=0
I get nearly identical results,
OR, if I do :
- Code: Select all
NEWDF.ddl$Phi$fix=NA
NEWDF.ddl$Phi$fix[NEWDF.ddl$Phi$group==1&NEWDF.ddl$Phi$time==2006]=1
NEWDF.ddl$Phi$fix[NEWDF.ddl$Phi$group==2&NEWDF.ddl$Phi$time==2007]=1
NEWDF.ddl$f$fix=NA
NEWDF.ddl$f$fix[NEWDF.ddl$f$group==1&NEWDF.ddl$f$time==2006]=0
NEWDF.ddl$f$fix[NEWDF.ddl$f$group==2&NEWDF.ddl$f$time==2007]=1
I get:
GROUP1:
Phi=0.93f=0.088
p=0.45
GROUP2:
Phi=0.64f=0.028
p=0.45
So survival is closer for Group 2, but f is off.
#######
I'm looking to understand how exactly the fixing of parameters is interpreted by the model. Phi must have to fixed at 1 for Group 2 in 2007, as surviving from 2006 to 2010 meant you were also alive in 2007. But the others are less clear to me. Group 1 Phi in 2006- should this be 1 or 0, as we first sampled individuals in 2007 in this area, so we really have no idea whether bears survived this period (2006-2007) or were new recruits?
Very sorry for the long message. I am hopeful this info will be used by others in the future though!
CL