Learn R Programming

Rcapture (version 1.3-1)

closedp: Loglinear Models for Closed Population Capture-Recapture Experiments

Description

The functions closedp.t and closedp.0 fit various loglinear models for closed populations in capture-recapture experiments. For back compatibility, closedp.t is also named closedp. closedp.t fits more models than closedp.0 but for data set with more than 20 capture occasions, the function might fail. However, closedp.0 works with fairly large data sets (see Details).

Usage

closedp(X, dfreq=FALSE, neg=TRUE)
closedp.t(X, dfreq=FALSE, neg=TRUE)

closedp.0(X, dfreq=FALSE, dtype=c("hist","nbcap"), t=NULL, t0=NULL, 
          neg=TRUE)

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

## S3 method for class 'closedp':
boxplot(x, main="Boxplots of Pearson Residuals", \dots)

## S3 method for class 'closedp':
plot(x, main="Residual plots for some heterogeneity models", \dots)

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.
dtype
A characters string, either "hist" or "nbcap", to specify the type of data. "hist", the default, means that X contains complete observed capture histories. "nbca
t
Requested only if dtype="nbcap". A numeric specifying the total number of capture occasions in the experiment. For closedp.0, the value t=Inf is accepted. It indicates that captures occur i
t0
A numeric. Models are fitted considering only the frequencies of units captured 1 to t0 times. By default, if t is not equal to Inf, t0=t. When t=Inf, the default value
neg
If this option is set to TRUE, negative eta parameters in Chao's lower bound models are set to zero (see Details).
x
An object, produced by a closedp function, to print or to plot.
main
A main title for the plot
...
Further arguments to be passed to methods (see print.default, boxplot.default and plot.default).

Value

  • nThe number of captured units.
  • tThe total number of capture occasions in the data matrix X.
  • t0For closedp.0 only: the value of the argument t0 used in the computations.
  • resultsA table containing, for every fitted model, the estimated population size and its standard error, the deviance, the number of degrees of freedom and the Akaike's information criterion. If the name of a model is followed by ** in this table, it means that the model did not converge. Therefore, the estimated population size for this model is questionable.
  • convergeA logical vector indicating whether or not the fitted models converged.
  • glmA list of the 'glm' objects obtained from fitting models.
  • glm.warnA list of character string vectors. If the glm.fit function generates one or more warnings when fitting a model, a copy of these warnings are stored in glm.warn$Mname where Mname is a short name to identify the model. A NULL list element means that glm.fit did not produce any warnings for the considered model.
  • parametersCapture-recapture parameters estimates. It contains N, the estimated population size, and p or $p_1$ to $p_t$ defined as follows for the different models : ll{ M0 the capture probability at any capture occasion Mt the capture probabilities for each capture occasion Mh models the average probability of capture Mth models the average probabilities of capture for each occasion Mb and Mbh the probability of first capture at any capture occasion } For models Mb and Mbh, it also contains c, the recapture probability at any capture occasion.
  • neg.etaThe position of the eta parameters set to zero in the loglinear parameter vector of model MhC and MthC. If not NULL, likelihood ratio tests cannot be conducted to test whether a particular heterogeneous model is adequate by comparing it's deviance to the deviance of Chao's lower bound model (see Details).
  • XA copy of the data given as input in the function call.
  • dfreqA copy of the dfreq argument given in the function call.

Details

closedp.t fits models M0, Mt, Mh Chao (LB), Mh Poisson2, Mh Darroch, Mh Gamma3.5, Mth Chao (LB), Mth Poisson2, Mth Darroch, Mth Gamma3.5, Mb and Mbh. closedp.0 fits only models M0, Mh Chao (LB), Mh Poisson2, Mh Darroch and Mh Gamma3.5. However, closedp.0 can be used with larger data sets than closedp.t. This is explained by the fact that closedp.t fits models using the frequencies of the observable capture histories (vector of size $2^t-1$), whereas closedp.0 uses the numbers of units captured i times, for $i=1,\ldots,t$ (vector of size $t$). Multinomial profile confidence intervals for the abundance are constructed by closedpCI.t and closedpCI.0. To calculate bias corrected abundance estimates, use the closedp.bc function. CHAO'S LOWER BOUND MODEL Chao's (or LB) models estimate a lower bound for the abundance, both with a time effect (Mth Chao) and without one (Mh Chao). The estimate obtained under Mh Chao is Chao's (1987) moment estimator. Rivest and Baillargeon (2007) exhibit a loglinear model underlying this estimator and provide a generalization to Mth. For these two models, a small deviance means that there is an heterogeneity in capture probabilities; it does not mean that the lower bound estimate is unbiased. To test whether a certain model for heterogeneity is adequate, one can conduct a likelihood ratio test by subtracting the deviance of Chao's model to the deviance of the heterogeneous model under study. If this heterogeneous model includes a time effect, it must be compared to model Mth Chao. If it does not include a time effect, it must be compared to model Mh Chao. Under the null hypothesis of equivalence between the two models, the difference of deviances follows a chi-square distribution with degrees of freedom equal to the difference between the models' degrees of freedom. Chao's lower bound models contain $t-2$ parameters, called eta parameters, for the heterogeneity. These parameters should theoretically be greater or equal to zero (see Rivest and Baillargeon (2007)). When the argument neg is set to TRUE (the default), negative eta parameters are set to zero (to do so, columns are removed from the design matrix of the model). Consequently, heterogeneous models are no longer particular cases of Chao's model. Therefore, likelihood ratio tests cannot be conducted anymore to test whether a chosen heterogeneous model is adequate. Also, the degrees of freedom of Chao's model increase when eta parameters are set to zero. OTHER MODELS FOR HETEROGENEITY Other models for heterogeneity are defined as follows : ll{ Model Column for heterogeneity in the design matrix Poisson2 $2^k-1$ Darroch $k^2/2$ Gamma3.5 $-\log(3.5 + k) + \log(3.5)$ } where $k$ is the number of captures. Poisson and Gamma models with alternative to the parameter defaults values 2 and 3.5 can be fitted with the closedpCI.t and closedpCI.0 functions. Darroch's models for Mh and Mth are considered by Darroch et al. (1993) and Agresti (1994). Poisson and Gamma models are discussed in Rivest and Baillargeon (2007). Poisson models typically yield smaller corrections for heterogeneity than Darroch's model since the capture probabilities are bounded from below under these models. On the other hand, Gamma models can lead to very large estimators of abundance. We suggest considering this estimator only in experiments where very small capture probabilities are likely. PLOT METHODS AND FUNCTIONS The boxplot.closedp function produces boxplots of the Pearson residuals of the fitted loglinear models that converged. The plot.closedp function produces scatterplots of the Pearson residuals in terms of $f_i$ (number of units captured i times) for the heterogeneous models Mh Poisson2, Mh Darroch and Mh Gamma3.5 if they converged.

References

Agresti, A. (1994) Simple capture-recapture models permitting unequal catchability and variable sampling effort. Biometrics, 50, 494--500. 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/v19/i05. Chao, A. (1987) Estimating the population size for capture-recapture data with unequal catchabililty. Biometrics, 45, 427--438. Darroch, S.E., Fienberg, G., Glonek, B. and Junker, B. (1993) A three sample multiple capture-recapture approach to the census population estimation with heterogeneous catchability. Journal of the American Statistical Association, 88, 1137--1148. Rivest, L.P. and Levesque, T. (2001) Improved loglinear model estimators of abundance in capture-recapture experiments. Canadian Journal of Statistics, 29, 555--572. Rivest, L.P. and Baillargeon, S. (2007) Applications and extensions of Chao's moment estimator for the size of a closed population. Biometrics, 63(4), 999--1006. Seber, G.A.F. (1982) The Estimation of Animal Abundance and Related Parameters, 2nd edition, New York: Macmillan.

See Also

closedpCI.t, closedpCI.0, closedp.bc, closedp.Mtb, uifit.

Examples

Run this code
data(hare)
hare.closedp<-closedp.t(hare)
hare.closedp
boxplot(hare.closedp)

data(mvole)
period3<-mvole[,11:15]
closedp.t(period3)

data(BBS2001)
BBS.closedp<-closedp.0(BBS2001,dfreq=TRUE,dtype="nbcap",t=50,t0=20)
BBS.closedp
plot(BBS.closedp)

### Seber (1982) p.107
# When there is 2 capture occasions, the heterogeneity models cannot be fitted
X <- matrix(c(1,1,167,1,0,781,0,1,254),byrow=TRUE,ncol=3)
closedp.t(X,dfreq=TRUE)

### Example of captures in continuous time
### Illegal immigrants data
data(ill)
closedp.0(ill, dtype="nbcap", dfreq=TRUE, t=Inf)

Run the code above in your browser using DataLab