Learn R Programming

VGAM (version 1.0-6)

aux.posbernoulli.t: Auxiliary Function for the Positive Bernoulli Family Function with Time Effects

Description

Returns behavioural effects indicator variables from a capture history matrix.

Usage

aux.posbernoulli.t(y, check.y = FALSE, rename = TRUE, name = "bei")

Arguments

y

Capture history matrix. Rows are animals, columns are sampling occasions, and values should be 0s and 1s only.

check.y

Logical, if TRUE then some basic checking is performed.

rename, name

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.

Value

A list with the following components.

cap.hist1

A matrix the same dimension as y. In any particular row there are 0s up to the first capture. Then there are 1s thereafter.

cap1

A vector specifying which time occasion the animal was first captured.

y0i

Number of noncaptures before the first capture.

yr0i

Number of noncaptures after the first capture.

yr1i

Number of recaptures after the first capture.

Details

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.

See Also

posbernoulli.t, deermice.

Examples

Run this code
# 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