openp: Loglinear Models for Open Population Capture-Recapture...

openpR Documentation

Loglinear Models for Open Population Capture-Recapture Experiments

Description

This function computes various demographic parameters using a loglinear model for open populations in capture-recapture experiments.

Usage

openp(X, dfreq=FALSE, m=c("up","ep"), neg=TRUE, keep=rep(TRUE,2^I-1))

## S3 method for class 'openp'
print(x, ...)

## S3 method for class 'openp'
plot(x, main="Scatterplot of Pearson Residuals", ...)

Arguments

X

The matrix of the observed capture histories (see Rcapture-package for a description of the accepted formats).

dfreq

A logical. By default FALSE, which means that X has one row per unit. If TRUE, it indicates that the matrix X contains frequencies in its last column.

m

This argument is a character string taking the value "up" (up = unconstrained probabilities) or "ep" (ep = equal probabilities). If m is set to "up" (the default), no constraint is set on the loglinear parameters. Therefore some loglinear and demographic parameters are not estimable. On the other hand, when m takes the value "ep", the capture probabilities are set to a common value; this enables the estimation of all the parameters.

keep

This option is useful to fit the model on a subset of the possible capture histories. keep is a logical vector of length 2^I-1 taking the value TRUE for a history kept and FALSE for a history put aside. In this vector, the order of the capture histories is as defined in the histpos.t function. By default, every capture history is kept.

neg

If this option is set to TRUE, relevant negative gamma parameters are set to zero. This insures that the estimated survival probabilities belong to [0, 1] and that the births are positive.

x

An object, produced by the openp function, to print or to plot.

main

A main title for the plot

...

Further arguments to be passed to methods (see print.default and plot.default).

Details

The function openp generates statistics to test the presence of a trap effect.

The plot.openp function produces a scatterplot of the Pearson residuals of the model versus the frequencies of capture.

If the data matrix X was obtained through the periodhist function, the dfreq argument must be set to TRUE.

Standard errors are calculated by linearization.

Value

n

The number of captured units

model.fit

A table containing the deviance, degrees of freedom and AIC of the fitted model.

trap.fit

A table containing, for the models with an added trap effect, the deviance, degrees of freedom and AIC.

trap.param

The estimated trap effect parameters and their standard errors. For m="up", the I-3 first rows of trap.param are estimations of the differences logit(capture probability after a capture)- logit(capture probability after a miss) for periods 3 to I-1. The last row gives a pooled estimate of these differences calculated under the assumption that they are homogeneous.

capture.prob

The estimated capture probabilities per period and their standard errors.

survivals

The estimated survival probabilities between periods and their standard errors.

N

The estimated population sizes per period and their standard errors.

birth

The estimated number of new arrivals in the population between periods and their standard errors.

Ntot

The estimated total number of units who ever inhabited the survey area and its standard error.

glm

The 'glm' object obtained from fitting the loglinear model

loglin.param

The loglinear model parameters estimations and their standard errors, calculated by the glm function.

u.vector

The Ui statistics, useful for the survival probabilities calculation, and their standard errors

v.vector

The Vi statistics, useful for the population sizes estimation, and their standard errors

cov

The covariance matrix of all the demographic parameters estimates.

neg

The position of the gamma parameters set to zero in the loglinear parameter vector.

Note

If your data contains more than one capture occasion within primary periods, use the periodhist function to create the input data matrix X needed by the openp function.

This function uses the glm function of the stats package.

Author(s)

Louis-Paul Rivest Louis-Paul.Rivest@mat.ulaval.ca and Sophie Baillargeon

References

Baillargeon, S. and Rivest, L.P. (2007) Rcapture: Loglinear models for capture-recapture in R. Journal of Statistical Software, 19(5), doi: 10.18637/jss.v019.i05.

Rivest, L.P. and Daigle, G. (2004) Loglinear models for the robust design in mark-recapture experiments. Biometrics, 60, 100–107.

See Also

closedp, periodhist, robustd

Examples

# duck data set
op.m1 <- openp(duck, dfreq = TRUE)
plot(op.m1)

# To remove the capture history 111111.
keep2 <- apply(histpos.t(6), 1, sum) != 6
op.m2 <- openp(duck, dfreq = TRUE, keep = keep2)
op.m2

# To remove the capture histories with 5 captures or more
keep3 <- apply(histpos.t(6), 1, sum) < 5
op.m3 <- openp(duck, dfreq = TRUE, keep = keep3)
op.m3


# mvole data set aggregated per primary period
mvole.op <- periodhist(mvole, vt = rep(5, 6))
openp(mvole.op, dfreq = TRUE)

Rcapture documentation built on May 4, 2022, 5:05 p.m.

Related to openp in Rcapture...