Last chance! 50% off unlimited learning
Sale ends in
Returns behavioural effects indicator variables from a capture history matrix.
aux.posbernoulli.t(y, check.y = FALSE, rename = TRUE, name = "bei")
Capture history matrix. Rows are animals, columns are sampling occasions, and values should be 0s and 1s only.
Logical, if TRUE
then some basic checking is performed.
If rename = TRUE
then the behavioural effects indicator
are named using the value of name
as the prefix.
If FALSE
then use the same column names as y
.
A list with the following components.
A matrix the same dimension as y
.
In any particular row there are 0s up to
the first capture. Then there are 1s thereafter.
A vector specifying which time occasion the animal was first captured.
Number of noncaptures before the first capture.
Number of noncaptures after the first capture.
Number of recaptures after the first capture.
This function can help fit certain capture--recapture models
(commonly known as posbernoulli.t
for details.
# NOT RUN {
# Fit a M_tbh model to the deermice data:
(pdata <- aux.posbernoulli.t(with(deermice, cbind(y1, y2, y3, y4, y5, y6))))
deermice <- data.frame(deermice,
bei = 0, # Add this
pdata$cap.hist1) # Incorporate these
head(deermice) # Augmented with behavioural effect indicator variables
tail(deermice)
# }
Run the code above in your browser using DataLab