openp                package:Rcapture                R Documentation

_L_o_g_l_i_n_e_a_r _M_o_d_e_l_s _f_o_r _O_p_e_n _P_o_p_u_l_a_t_i_o_n _C_a_p_t_u_r_e-_R_e_c_a_p_t_u_r_e _E_x_p_e_r_i_m_e_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

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

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

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

_A_r_g_u_m_e_n_t_s:

       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 experiment (noted I). In the alternative
          format, it contains one row per capture history followed by
          its frequency. In that case, 'X' has I+1 columns. The first I
          columns of 'X', identifying the capture histories, must
          contain only zeros and ones. The number one indicates a
          capture. 

   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 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.

     ...: Further arguments passed to or from other methods.

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

       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 homogenous.

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.

_N_o_t_e:

     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.

_A_u_t_h_o_r(_s):

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

_R_e_f_e_r_e_n_c_e_s:

     Baillargeon, S. and Rivest, L.P. (2007). The Rcapture package:
     Loglinear models for capture-recapture in R. _Journal of
     Statistical Software_, to appear (available online at <URL:
     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.

_S_e_e _A_l_s_o:

     'closedp', 'periodhist', 'robustd.t', 'robustd.0'

_E_x_a_m_p_l_e_s:

     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)

