Hi all,
I had run a CJS model using data of "dipper" with RMARK [Package RMark] and library (FSA)[ based on the Introductory Fisheries Analysis with R, written by Derek H. Ogle; 2015, Chapman and Hall], but I got different results. Would you give me some suggestions which results are correct.
I used the "dipper data" but for Female (the r code is given).
For example: period 1 and 2 the survival rate is : 0.742 using FSA, whereas Rmark gives "0.718"
I am not sure which results are the right . Furthermore, Rmark provides the survival rate and detection rate of the last detection time (period 6 to 7: 0.7655); I think it should have the value "NA". The FSA provides "NA" for the last detection time ( See below). I have attached the code for your reference.
> cut.op$survivals
estimate stderr
period 1 -> 2 0.7428571 0.23722150
period 2 -> 3 0.4468410 0.09828285
period 3 -> 4 0.4538126 0.08153503
period 4 -> 5 0.6404243 0.08323359
period 5 -> 6 0.6280454 0.08105155
period 6 -> 7 NA NA
Whereas RMark gives
1980 1981 1982 1983 1984 1985
1980 0.718 0.435 0.478 0.626 0.599 0.766
1981 0.435 0.478 0.626 0.599 0.766
1982 0.478 0.626 0.599 0.766
1983 0.626 0.599 0.766
1984 0.599 0.766
1985 0.766
### following code I used for the above result
library(FSA)
library(RMark)
rm(list=ls(all=TRUE))
data(dipper)
head(dipper)
########################
## based on RMark
#########################
dipper.process=process.data(dipper,model="CJS",begin.time=1980,groups="sex")
dipper.ddl=make.design.data(dipper.process)
Phi.dot=list(formula=~1)
p.dot=list(formula=~1)
Phi.time=list(formula=~time)
Phi.sex=list(formula=~sex)
p.time=list(formula=~time)
p.Time=list(formula=~Time)
dipper.phi.time.p.time= mark(dipper.process,dipper.ddl,model.parameters=list(Phi=Phi.time,p=p.time))
summary(dipper.phi.time.p.time)
#################################
###### this is based on FSA, see book (introductory fisheries Analysis with R)
##########################################
DIPPER<-separate(dipper, ch, into = c("a1", "a2", "a3", "a4", "a5", "a6", "a7"), sep = c(1,2,3,4,5,6), remove = F)
head(DIPPER)
DIPPER_Female<-subset(DIPPER, DIPPER$sex=="Female")
head(DIPPER_Female)
Test1<-data.frame(subset(DIPPER_Female, select=c(-9)))
head(Test1)
summary(Test1)
# convert factor to numeric
Test1[,2:8] <- lapply(Test1[,2:8], function(x) as.numeric(as.character(x)))
summary(Test1)
#################################
###### this is based on library (FSA), see book (introductory fisheries Analysis with R)
##########################################
cut.ch1<-capHistSum(Test1,cols2use=-1)
cut.ch1$methodB.top
data.frame(cut.ch1$caphist)
cut.op<-openp(Test1[,-1])
cut.op$survivals
cut.op$capture.prob