Simpsonci               package:MCPAN               R Documentation

_C_o_n_f_i_d_e_n_c_e _i_n_t_e_r_v_a_l_s _f_o_r _d_i_f_f_e_r_e_n_c_e_s _o_f _S_i_m_p_s_o_n _i_n_d_i_c_e_s

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

     Calculates simultaneous and local confidence intervals for
     differences of Simpson indices.

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

     Simpsonci(X, f, cmat = NULL, type = "Dunnett", alternative = "two.sided", conf.level = 0.95, dist = "MVN", ...)

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

       X: a data.frame of dimensions 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'  

    cmat: an contrast matrix; the number of columns should match the
          number of levels in 'f'

    type: a single character string, currently one of
          "Dunnett","Tukey","Sequen" 

alternative: a single character string, one of "two.sided","less"
          (upper bounds),"greater" (lower bounds) 

conf.level: the confidence level of the simultaneous (or local)
          confidence intervals 

    dist: a single character string, defining the type of quantiles to
          be used for interval calculation; "MVN" invokes simultaneous
          intervals, "N" invokes unadjusted confidence intervals with
          coverage probability conf.level for each of them  

     ...: further arguments to be passed; currently only 'base' is
          used,a single integer value, specifying which group to be
          taken as the control in case that 'type="Dunnett"', ignored
          otherwise

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

     This function implements confidence intervals described by Rogers
     and Hsu (1999) for the difference of Shannon indices between
     several groups. Deviating from Fritsch and Hsu, quantiles of the
     multivariate normal distribution are used which take the sample
     variance into account.

     Note, that this approach ignores the variability of the individual
     samples.

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

     A list containing the elements:

conf.int : a matrix, containing the lower and upper confidence limits
          in the columns

quantile: a single numeric value, the quantile used for interval
          calculation

estimate : a matrix,containing the point estimates of the contrasts in
          its column

    cmat: the contrast matrix used

methodname: a character string, for printing

sample.estimate: A list of sample estimates as returned by estShannonf 

     and some of the input arguments.

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

     Frank Schaarschmidt

_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:

     Shannonci

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

     data(HCD)

     HCDcounts<-HCD[,-1]
     HCDf<-HCD[,1]

     # Rogers and Hsu (2001), Table 2:
     # All pair wise comparisons:

     Simpsonci(X=HCDcounts, f=HCDf, type = "Tukey",
      conf.level = 0.95, dist = "MVN")

     # Rogers and Hsu (2001), Table 3:
     # Comparison to the lower cretaceous:

     Simpsonci(X=HCDcounts, f=HCDf, type = "Dunnett",
      alternative = "less", conf.level = 0.95, dist = "MVN")

     # Note, that the confidence bounds here differ
     # from the bounds in Rogers and Hsu (2001) 
     # in the second digit, whenever the group Upper
     # is involved in the comparison.

     # Stepwise comparison between the strata:

     SimpsonS<-Simpsonci(X=HCDcounts, f=HCDf, type = "Sequen",
      alternative = "greater", conf.level = 0.95, dist = "MVN")

     SimpsonS
     summary(SimpsonS)

     plot(SimpsonS)

     # # # Hell Creek Dinosaur data:
     # Is there a downward trend in biodiversity during the 
     # Creataceous period?

     # A trend test based on multiple contrasts:

     cmatTREND<-rbind(
     "U-LM"=c(-0.5,-0.5,1),
     "MU-L"=c(-1,0.5,0.5),
     "U-L"=c(-1,0,1)
     )

     TrendCI<-Simpsonci(X=HCDcounts, f=HCDf, cmat=cmatTREND, alternative = "greater", conf.level = 0.95, dist = "MVN")
     TrendCI

     plot(TrendCI)

