estSimpsonf              package:MCPAN              R Documentation

_E_s_t_i_m_a_t_e _t_h_e _S_i_m_p_s_o_n _i_n_d_e_x _f_r_o_m _s_e_v_e_r_a_l _s_a_m_p_l_e_s

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

     Calculate estimates of the Simpson index after pooling over
     several samples, grouped by a factor variable.

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

     estSimpsonf(X, f)

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

       X: a data.frame of dimension n times p with integer entries,
          where n is the number of samples and p is the number of
          species 

       f: a factor variable of length n, grouping the observations in
          'X' 

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

     The function splits 'X' according to the levels of the grouping
     variable 'f', builds the sum over each column and calculates the
     Shannon index ove the resulting counts.

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

     A list containing the items: 

estimate : the groupwise point estimates of the Simpson index

 varest : the groupwise variance estimates of the Simpson index

  table : a matrix of counts,containing the summed observations for
          each level of 'f' in its rows

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

     Rogers, JA and Hsu, JC (2001): Multiple Comparisons of
     Biodiversity. Biometrical Journal 43, 617-625.

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

     estShannonf

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

     # Here, the estimates for the Hell Creek Dinosaur 
     # example are compared to the estimates in 
     # Tables 2 and 3 of Rogers and Hsu (2001).

     data(HCD)
     HCD

     # Groupwise point estimates:

     est<-estSimpsonf(X=HCD[,-1], f=HCD[,1])

     est

     # Table 2:

     cmat<-rbind(
     "lower-middle"=c(1,-1,0),
     "lower-upper"=c(1, 0,-1),
     "middle-upper"=c(0,1,-1))

     # the point estimates:

     # cmat 
     crossprod(t(cmat), est$estimate)

     # the standard errors:
     # sqrt(diag(cmat 

     sqrt(diag(crossprod(t(cmat), crossprod(diag(est$varest), t(cmat)) ) ))

     # Table 3:

     cmat<-rbind(
     "middle-lower"=c(-1,1,0),
     "upper-lower"=c(-1,0,1))

     # cmat 
     crossprod(t(cmat), est$estimate)

     # sqrt(diag(cmat 

     sqrt(diag(crossprod(t(cmat), crossprod(diag(est$varest), t(cmat)) ) ))

     # Note, that the point estimates are exactly
     # the same as in Rogers and Hsu (2001),
     # but the variance estimates are not, whenever
     # the Upper group is involved.

