How do you manually set the PIMs in a CJS analysis in rmark?? I need one of the Phis to be shared between two occasions.
In MARK, I was able to run a four-occasion CJS, with time intervals set to {1,8,8}, a sin link, and with the second and third Phis being shared. Phi and p PIMs looked like this
1__2__2____3__4__5
___2__2_______4__5
______2__________5
I am hoping the fact that I cannot find documentation for this is evidence simply of it being an odd request (or that I am bad at finding answers within this forum), rather than it being impossible. I am trying to replicate an analysis that I did in MARK, but this time using rmark so that I can bootstrap the input data and see how decreases in sampling could affect the resulting confidence bounds. But before I can code the bootstrapping, I first need to make sure the R code for the base analysis produces that same results as when I ran it manually in MARK.
Here is what I have so far:
- Code: Select all
formark = data.frame(DH.2017W$DH)
colnames(formark)=c("ch")
tapply(formark$ch,formark$ch, length)
1000_1001_1100_1101
5083___43____4____1
- Code: Select all
time.intervals = c(1, 8, 8)
m.proc = process.data(data = formark, model = "CJS", time.intervals = time.intervals)
Phi.time=list(formula=~time)
p.time=list(formula=~time)
m.ddl = make.design.data(data = m.proc, parameters = list(Phi = list(pim.type = "time"),p =list(pim.type = "time")))
m.ddl$Phi$model.index = c(1,2,2)
m.ddl$p$model.index = c(3,4,5)
m.ddl$Phi
__par.index_model.index_group_time_Time
1______ 1____________1_____1____1____0
2______ 2____________2_____1____1____1
3______ 3____________2_____1___10____9
- Code: Select all
m.model = mark(data = m.proc,
ddl = m.ddl,
model.name = "Phi.time.occ2eq3.p.time",
input.links = rep("sin", 6),
model.parameters=list(Phi=Phi.time, p = p.time) )
But when I run this, it ignores my attempt to set the PIMS, and I get this
- Code: Select all
> m.model$pims
$Phi
$Phi[[1]]
$Phi[[1]]$pim
___[,1]_[,2]_[,3]
[1,]__1___2___3
[2,]__0___2___3
[3,]__0___0___3
$p
$p[[1]]
$p[[1]]$pim
___[,1]_[,2]_[,3]
[1,]__4___5___6
[2,]__0___5___6
[3,]__0___0___6
What am I doing wrong?
Any help would be much apprecaited.
Thanks in advance,
Dave