mortality                package:CTFS                R Documentation

_A_n_n_u_a_l _M_o_r_t_a_l_i_t_y _R_a_t_e_s _b_y _C_a_t_e_g_o_r_i_e_s (_U_s_e_r _d_e_f_i_n_e_d _g_r_o_u_p_s)

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

     Computes annual mortality rate for all trees or any user defined
     categorization of trees.  Any two census datasets can be provided
     in order of date of census.  The annual mortality rate and other
     statistics are computed for user defined categories.

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

     mortality(census1, census2, alivecode = c("A", "AB", "AS"), 
             split1 = NULL, split2 = NULL)

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

 census1: name of census datafile for first census, must be a
          *dataframe*, must be of same length as 'census2'

 census2: name of census datafile for second census, must be a
          *dataframe*, must be of same length as 'census1'

alivecode: character, codes of the variable 'status'  that indicate the
          tree is alive.  The most general valid categories are: "A"
          and  "AB" and "AS".

  split1: a *vector* of categorical values of the same  length as
          'census' which groups trees into classes of  interest for
          which mortality values are computed.  This vector can be 
          composed of characters or numbers.

  split2: a second *vector* of categorical values of the same  length
          as 'census' which groups trees into classes of  interest for
          which mortality values are computed.  This vector can be 
          composed of characters or numbers.

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

     See 'CTFS.mortality' for details on the computation of  mortality
     rates and associated functions.

     Any two censuses on a datafile must be used. They do not have to
     be  sequential, only that 'census1' has to be before 'census2'.

     The vectors 'split1' and 'split2' must be of the same length as
     'census1' and 'census2' but can contain NA. 

     Take care when creating a split vector based on dbh.  Mortality is
     computed on the surviving trees which have valid dbhs in both
     censuses. However, dead trees only have a valid dbh for the first
     census of any interval.  If the second census is used then no dead
     trees will be identified.  So a dbh vector must be based on the
     first census of the interval.  The inverse if true for
     recruitment.  Therefore the same dbh split vector CANNOT be used
     for computations of recruitment and mortality.  Use a dbh vector
     based on the census1 for mortality and on  census2 for
     recruitment.

     The results of 'mortality' can be organized into *dataframes* with
     the use of 'assemble.demography'.

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

     'mortality' returns a *list of arrays* with the values of 'split1'
     as the first dimension and the values of 'split2' as the second
     dimension of the array.  The array contains the following named
     components:

     $N0: the number of living trees at the first census

      $S: the number of surviving trees from the first to second census

      $D: the number of trees that died between the first and  second
          census

   $rate: the mortality in %/year

  $lower: the lower 95% confidence interval

  $upper: the upper 95% confidence interval

$dbhmean: the mean dbh in mm for trees used to compute  mortality

$meanyrs: mean number of years between census for trees used in 
          mortality rate computation.

  $date1: mean date of first census

  $date2: mean date of second census


     If the vector(s) 'split1' and 'split2' are provided by the user,
     then mortality rates and associated statistics are computed for
     each value of the vectors.  The vectors are nested so that
     mortality rates is computed for each category of 'split2' within
     each category of 'split1'.  Mortality values are returned for all
     levels of each vector and if no value can be computed then 0 or NA
     is returned as appropriate.

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

     Rick Condit and Pamela Hall

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

     'CTFS.mortality'

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

     ## Not run: 

     1. Default use of mortality()
     mort.out <- mortality(tst.bci90.full, tst.bci95.full)
     mort.out

     2. Create a vector of species names for each tree to compute mortality 
     rates for each species.

     spp.vct <- tst.bci90.full$sp
     mort.spp.out <- mortality(tst.bci90.full, tst.bci95.full, split1 = spp.vct)

     3. Create 2 vectors: the first of habitats based on the quad location 
     of each tree and the second of tree species names.

     habitat.vct <- sep.quadinfo(tst.bci90.full, bciquad.info, by.col = "hab")
     spp.vct <- tst.bci90.full$sp

     mort.spp.hab.out <- mortality(tst.bci90.full, tst.bci95.full, split1=spp.vct, split2=habitat.vct)
     ## End(Not run)

