View source: R/diversity.evaluate.core.R
diversity.evaluate.core | R Documentation |
Compute the following diversity indices and perform corresponding statistical tests to compare the phenotypic diversity for qualitative traits between entire collection (EC) and core set (CS).
Simpson's and related indices
Simpson's Index (\mjseqnd) \insertCitesimpson_measurement_1949,peet_measurement_1974EvaluateCore
Simpson's Index of Diversity or Gini's Diversity Index or Gini-Simpson Index or Nei's Diversity Index or Nei's Variation Index (\mjseqnD) \insertCitegini_variabilita_1912,gini_variabilita_1912-2,greenberg_measurement_1956,berger_diversity_1970,nei_analysis_1973,peet_measurement_1974EvaluateCore
Maximum Simpson's Index of Diversity or Maximum Nei's Diversity/Variation Index (\mjseqnD_max) \insertCitehennink_interpretation_1990EvaluateCore
Simpson's Reciprocal Index or Hill's \mjseqnN_2 (\mjseqnD_R) \insertCitewilliams_patterns_1964,hill_diversity_1973EvaluateCore
Relative Simpson's Index of Diversity or Relative Nei's Diversity/Variation Index (\mjseqnD') \insertCitehennink_interpretation_1990EvaluateCore
Shannon-Weaver and related indices
Shannon or Shannon-Weaver or Shannon-Weiner Diversity Index (\mjseqnH) \insertCiteshannon_mathematical_1949,peet_measurement_1974EvaluateCore
Maximum Shannon-Weaver Diversity Index (\mjseqnH_max) \insertCitehennink_interpretation_1990EvaluateCore
Relative Shannon-Weaver Diversity Index or Shannon Equitability Index (\mjseqnH') \insertCitehennink_interpretation_1990EvaluateCore
McIntosh Diversity Index
McIntosh Diversity Index (\mjseqnD_Mc) \insertCitemcintosh_index_1967,peet_measurement_1974EvaluateCore
diversity.evaluate.core(data, names, qualitative, selected, base = 2, R = 1000)
data |
The data as a data frame object. The data frame should possess one row per individual and columns with the individual names and multiple trait/character data. |
names |
Name of column with the individual names as a character string |
qualitative |
Name of columns with the qualitative traits as a character vector. |
selected |
Character vector with the names of individuals selected in
core collection and present in the |
base |
The logarithm base to be used for computation of Shannon-Weaver Diversity Index (\mjseqnI). Default is 2. |
R |
The number of bootstrap replicates. Default is 1000. |
A list with three data frames as follows.
simpson |
|
shannon |
|
mcintosh |
|
The diversity indices and the corresponding statistical
tests implemented in diversity.evaluate.core
are as follows.
Simpson's index (\mjseqnd) which estimates the probability that two accessions randomly selected will belong to the same phenotypic class of a trait, is computed as follows \insertCitesimpson_measurement_1949,peet_measurement_1974EvaluateCore.
\mjsdeqnd = \sum_i = 1^kp_i^2
Where, \mjseqnp_i denotes the proportion/fraction/frequency of accessions in the \mjseqnith phenotypic class for a trait and \mjseqnk is the number of phenotypic classes for the trait.
The value of \mjseqnd can range from 0 to 1 with 0 representing maximum diversity and 1, no diversity.
\mjseqnd is subtracted from 1 to give Simpson's index of diversity (\mjseqnD) \insertCitegreenberg_measurement_1956,berger_diversity_1970,peet_measurement_1974,hennink_interpretation_1990EvaluateCore originally suggested by \insertCitegini_variabilita_1912,gini_variabilita_1912-2;textualEvaluateCore and described in literature as Gini's diversity index or Gini-Simpson index. It is the same as Nei's diversity index or Nei's variation index \insertCitenei_analysis_1973,hennink_interpretation_1990EvaluateCore. Greater the value of \mjseqnD, greater the diversity with a range from 0 to 1.
\mjsdeqnD = 1 - d
The maximum value of \mjseqnD, \mjseqnD_max occurs when accessions are uniformly distributed across the phenotypic classes and is computed as follows \insertCitehennink_interpretation_1990EvaluateCore.
\mjsdeqnD_max = 1 - \frac1k
Reciprocal of \mjseqnd gives the Simpson's reciprocal index (\mjseqnD_R) \insertCitewilliams_patterns_1964,hennink_interpretation_1990EvaluateCore and can range from 1 to \mjseqnk. This was also described in \insertCitehill_diversity_1973;textualEvaluateCore as (\mjseqnN_2).
\mjsdeqnD_R = \frac1d
Relative Simpson's index of diversity or Relative Nei's diversity/variation index (\mjseqnH') \insertCitehennink_interpretation_1990EvaluateCore is defined as follows \insertCitepeet_measurement_1974EvaluateCore.
\mjsdeqnD' = \fracDD_max
Differences in Simpson's diversity index for qualitative traits of EC and CS can be tested by a t-test using the associated variance estimate described in \insertCitesimpson_measurement_1949;textualEvaluateCore \insertCitelyons_c20_1978EvaluateCore.
The t statistic is computed as follows.
\mjsdeqnt = \fracd_EC - d_CS\sqrtV_d_EC + V_d_CS
Where, the variance of \mjseqnd (\mjseqnV_d) is,
\mjsdeqnV_d = \frac4N(N-1)(N-2)\sum_i=1^k(p_i)^3 + 2N(N-1)\sum_i=1^k(p_i)^2 - 2N(N-1)(2N-3) \left( \sum_i=1^k(p_i)^2 \right)^2[N(N-1)]^2
The associated degrees of freedom is computed as follows.
\mjsdeqndf = (k_EC - 1) + (k_CS - 1)
Where, \mjseqnk_EC and \mjseqnk_CS are the number of phenotypic classes in the trait for EC and CS respectively.
An index of information \mjseqnH, was described by \insertCiteshannon_mathematical_1949;textualEvaluateCore as follows.
\mjsdeqnH = -\sum_i=1^kp_i \log_2(p_i)
\mjseqnH is described as Shannon or Shannon-Weaver or Shannon-Weiner diversity index in literature.
Alternatively, \mjseqnH is also computed using natural logarithm instead of logarithm to base 2.
\mjsdeqnH = -\sum_i=1^kp_i \ln(p_i)
The maximum value of \mjseqnH (\mjseqnH_max) is \mjseqn\ln(k). This value occurs when each phenotypic class for a trait has the same proportion of accessions.
\mjsdeqnH_max = \log_2(k)\;\; \textrmOR \;\; H_max = \ln(k)
The relative Shannon-Weaver diversity index or Shannon equitability index (\mjseqnH') is the Shannon diversity index (\mjseqnI) divided by the maximum diversity (\mjseqnH_max).
\mjsdeqnH' = \fracHH_max
Differences in Shannon-Weaver diversity index for qualitative traits of EC and CS can be tested by Hutcheson t-test \insertCitehutcheson_test_1970EvaluateCore.
The Hutcheson t statistic is computed as follows.
\mjsdeqnt = \fracH_EC - H_CS\sqrtV_H_EC + V_H_CS
Where, the variance of \mjseqnH (\mjseqnV_H) is,
\mjsdeqnV_H = \frac\sum_i=1^kn_i(\log_2n_i)^2 \frac(\sum_i=1^k\log_2n_i)^2NN^2
\mjsdeqn\textrmOR
\mjsdeqnV_H = \frac\sum_i=1^kn_i(\lnn_i)^2 \frac(\sum_i=1^k\lnn_i)^2NN^2
The associated degrees of freedom is approximated as follows.
\mjsdeqndf = \frac(V_H_EC + V_H_CS)^2\fracV_H_EC^2N_EC + \fracV_H_CS^2N_CS
A similar index of diversity was described by \insertCitemcintosh_index_1967;textualEvaluateCore as follows (\mjseqnD_Mc) \insertCitepeet_measurement_1974EvaluateCore.
\mjsdeqnD_Mc = \fracN - \sqrt\sum_i=1^kn_i^2N - \sqrtN
Where, \mjseqnn_i denotes the number of accessions in the \mjseqnith phenotypic class for a trait and \mjseqnN is the total number of accessions so that \mjseqnp_i = n_i/N.
Bootstrap statistics are employed to test the difference between the Simpson, Shannon-Weaver and McIntosh indices for qualitative traits of EC and CS \insertCitesolow_simple_1993EvaluateCore.
If \mjseqnI_EC and \mjseqnI_CS are the diversity indices with the original number of accessions, then random samples of the same size as the original are repeatedly generated (with replacement) \mjseqnR times and the corresponding diversity index is computed for each sample.
\mjsdeqnI_EC^* = \lbrace H_EC_1, H_EC_, \cdots, H_EC_R \rbrace
\mjsdeqnI_CS^* = \lbrace H_CS_1, H_CS_, \cdots, H_CS_R \rbrace
Then the bootstrap null sample \mjseqnI_0 is computed as follows.
\mjsdeqn\Delta^* = I_EC^* - I_CS^*
\mjsdeqnI_0 = \Delta^* - \overline\Delta^*
Where, \mjseqn\overline\Delta^* is the mean of \mjseqn\Delta^*.
Now the original difference in diversity indices (\mjseqn\Delta_0 = I_EC - I_CS) is tested against mean of bootstrap null sample (\mjseqnI_0) by a z test. The z score test statistic is computed as follows.
\mjsdeqnz = \frac\Delta_0 - \overlineH_0\sqrtV_H_0
Where, \mjseqn\overlineH_0 and \mjseqnV_H_0 are the mean and variance of the bootstrap null sample \mjseqnH_0.
The corresponding degrees of freedom is estimated as follows.
\mjsdeqndf = (k_EC - 1) + (k_CS - 1)
shannon
, diversity
,
boot
data("cassava_CC") data("cassava_EC") ec <- cbind(genotypes = rownames(cassava_EC), cassava_EC) ec$genotypes <- as.character(ec$genotypes) rownames(ec) <- NULL core <- rownames(cassava_CC) quant <- c("NMSR", "TTRN", "TFWSR", "TTRW", "TFWSS", "TTSW", "TTPW", "AVPW", "ARSR", "SRDM") qual <- c("CUAL", "LNGS", "PTLC", "DSTA", "LFRT", "LBTEF", "CBTR", "NMLB", "ANGB", "CUAL9M", "LVC9M", "TNPR9M", "PL9M", "STRP", "STRC", "PSTR") ec[, qual] <- lapply(ec[, qual], function(x) factor(as.factor(x))) diversity.evaluate.core(data = ec, names = "genotypes", qualitative = qual, selected = core)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.