aux.posbernoulli.t | R Documentation |
Returns behavioural effects indicator variables from a capture history matrix.
aux.posbernoulli.t(y, check.y = FALSE, rename = TRUE, name = "bei")
y |
Capture history matrix. Rows are animals, columns are sampling occasions, and values should be 0s and 1s only. |
check.y |
Logical, if |
rename , name |
If |
This function can help fit certain capture–recapture models
(commonly known as M_{tb}
or M_{tbh}
(no prefix h
means it is an intercept-only model)
in the literature).
See posbernoulli.t
for details.
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.
posbernoulli.t
,
deermice
.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.