Learn R Programming

Rcapture (version 1.1)

openp: 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="up" , neg=TRUE, keep=rep(TRUE,2^I-1))

## S3 method for class 'openp':
print(x, \dots)

## S3 method for class 'openp':
plot(x, \dots)

Arguments

X
The table of the observed capture histories in one of the two accepted formats. In the default format, it has one row per unit captured in the experiment. In this case, the number of columns in the table represents the number of capture occasions in the e
dfreq
This argument specifies the format of the data matrix X. By default, it is set to FALSE, which means that X has one row per unit. If it is set to TRUE, then 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 fixed on the loglinear parameters. Therefore some loglinear a
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 capt
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.
...
Further arguments passed to or from other methods.

Value

  • nThe number of captured units
  • model.fitA table containing the deviance, degrees of freedom and AIC of the fitted model.
  • trap.fitA table containing, for the models with an added trap effect, the deviance, degrees of freedom and AIC.
  • trap.paramThe 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 homogenous.
  • capture.probThe estimated capture probabilities per period and their standard errors.
  • survivalsThe estimated survival probabilities between periods and their standard errors.
  • NThe estimated population sizes per period and their standard errors.
  • birthThe estimated number of new arrivals in the population between periods and their standard errors.
  • NtotThe estimated total number of units who ever inhabited the survey area and its standard error.
  • glmThe 'glm' object obtained from fitting the loglinear model
  • loglin.paramThe loglinear model parameters estimations and their standard errors, calculated by the glm function.
  • u.vectorThe Ui statistics, useful for the survival probabilities calculation, and their standard errors
  • v.vectorThe Vi statistics, useful for the population sizes estimation, and their standard errors
  • covThe covariance matrix of all the demographic parameters estimates.
  • negThe position of the gamma parameters set to zero in the loglinear parameter vector.

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.

References

Baillargeon, S. and Rivest, L.P. (2007). Rcapture: Loglinear models for capture-recapture in R. Journal of Statistical Software, 19(5), http://www.jstatsoft.org/ 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.t, robustd.0

Examples

Run this code
data(duck)
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


data(mvole)
mvole.op<-periodhist(mvole,vt=rep(5,6))
openp(mvole.op, dfreq=TRUE)

Run the code above in your browser using DataLab