otis | R Documentation |
This functions fits models M0, Mt, Mh, and Mb and variations of those models.
otis(y2d,mhst=NULL, cov=NULL)
y2d |
nind x K (occasions) matrix of encounter histories. A standard closed population capture-recapture data set. |
mhst |
Starting values for the logit-normal model Mh in order: (logit(p0), log(mu), log(n0)) where n0 = N - n. If no starting values are provided, the function does a grid search to find a decent starting value (this can take some time). |
cov |
This is a K x 1 vector of some covariate that might explain variation in detection probability over time. e.g., a linear trend covariate or weather conditions. If supplied then models which include this covariate will be fitted. |
Default setting (cov=NULL) will fit 4 models: M0, Mb, Mh (logit-normal) and Mh (2-point finite mixture).
If cov= is specified then Mcov and Mb+cov are fitted
Soon we will fit other models too.
Returns an AIC table including other model summaries (Nhat) and a table of model coefficients.
Andy Royle
Otis et al. (1978)
# see also ?peromyscus
library(scrbook)
data(beardata)
trapmat<-beardata$trapmat
nind<-dim(beardata$bearArray)[1]
K<-dim(beardata$bearArray)[3]
ntraps<-dim(beardata$bearArray)[2]
bearArray<-beardata$bearArray
# Convert 3d array to 2d array
y<- flatten(bearArray)
# Fit some basic CR models
otis(y)
# A simulation study:
N<- 100
K<- 8
nsims<- 1
for(sim in 1:nsims){
y<- matrix(0,nrow=N,ncol=K)
for(i in 1:N){
p<- plogis(rnorm(1,-1.85, 0.5))
y[i,]<- rbinom(K, 1, p)
}
y<- y[apply(y,1,sum)>0,]
otis(y, cov=c(1,1,1,1,0,0,0,0))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.