diversity.evaluate.core: Diversity Indices

View source: R/diversity.evaluate.core.R

diversity.evaluate.coreR Documentation

Diversity Indices

Description

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

\loadmathjax

Usage

diversity.evaluate.core(data, names, qualitative, selected, base = 2, R = 1000)

Arguments

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

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.

Value

A list with three data frames as follows.

simpson
Trait

The qualitative trait.

EC_No.Classes

The number of classes in the trait for EC.

CS_No.Classes

The number of classes in the trait for CS.

EC_d

The Simpson's Index (\mjseqnd) for EC.

EC_D

The Simpson's Index of Diversity (\mjseqnD) for EC.

EC_D.max

The Maximum Simpson's Index of Diversity (\mjseqnD_max) for EC.

EC_D.inv

The Simpson's Reciprocal Index (\mjseqnD_R) for EC.

EC_D.rel

The Relative Reciprocal Index (\mjseqnD') for EC.

EC_d.V

The variance of \mjseqnd for EC according to \insertCitesimpson_measurement_1949EvaluateCore.

EC_d.boot.V

The bootstrap variance of \mjseqnd for EC.

CS_d

The Simpson's Index (\mjseqnd) for CS.

CS_D

The Simpson's Index of Diversity (\mjseqnD) for CS.

CS_D.max

The Maximum Simpson's Index of Diversity (\mjseqnD_max) for CS.

CS_D.inv

The Simpson's Reciprocal Index (\mjseqnD_R) for CS.

CS_D.rel

The Relative Reciprocal Index (\mjseqnD') for CS.

CS_d.V

The variance of \mjseqnd for CS according to \insertCitesimpson_measurement_1949EvaluateCore.

CS_d.boot.V

The bootstrap variance of \mjseqnd for CS.

d.t.df

The degrees of freedom for t test.

d.t.stat

The t statistic.

d.t.pvalue

The p value for t test.

d.t.significance

The significance of t test for t-test

d.boot.z.df

The degrees of freedom for bootstrap z score.

d.boot.z.stat

The bootstrap z score.

d.boot.z.pvalue

The p value of z score.

d.boot.z.significance

The significance of z score.

shannon
Trait

The qualitative trait.

EC_No.Classes

The number of classes in the trait for EC.

CS_No.Classes

The number of classes in the trait for CS.

EC_I

The Shannon-Weaver Diversity Index (\mjseqnI) for EC.

EC_I.max

The Maximum Shannon-Weaver Diversity Index (\mjseqnI_max) for EC.

EC_I.rel

The Relative Shannon-Weaver Diversity Index (\mjseqnI') for EC.

EC_I.V

The variance of \mjseqnI for EC according to \insertCitehutcheson_test_1970EvaluateCore.

EC_I.boot.V

The bootstrap variance of \mjseqnI for EC.

CS_I

The Shannon-Weaver Diversity Index (\mjseqnI) for CS.

CS_I.max

The Maximum Shannon-Weaver Diversity Index (\mjseqnI_max) for CS.

CS_I.rel

The Relative Shannon-Weaver Diversity Index (\mjseqnI') for CS.

CS_I.V

The variance of \mjseqnI for CS according to \insertCitehutcheson_test_1970EvaluateCore.

CS_I.boot.V

The bootstrap variance of \mjseqnI for CS.

I.t.stat

The t statistic.

I.t.df

The degrees of freedom for t test.

I.t.pvalue

The p value for t test.

I.t.significance

The significance of t test for t-test

I.boot.z.df

The degrees of freedom for bootstrap z score.

I.boot.z.stat

The bootstrap z score.

I.boot.z.pvalue

The p value of z score.

I.boot.z.significance

The significance of z score.

mcintosh
EC_No.Classes

The number of classes in the trait for EC.

CS_No.Classes

The number of classes in the trait for CS.

EC_D.Mc

The McIntosh Index (\mjseqnD_Mc) for EC.

CS_D.Mc

The McIntosh Index (\mjseqnD_Mc) for CS.

M.boot.z.stat

The bootstrap z score.

M.boot.z.df

The degrees of freedom for bootstrap z score.

M.boot.z.pvalue

The p value of z score.

M.boot.z.significance

The significance of z score.

Details

The diversity indices and the corresponding statistical tests implemented in diversity.evaluate.core are as follows.

Simpson's and related indices

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.

\mjsdeqn

d = \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.

\mjseqn

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

\mjsdeqn

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

\mjsdeqn

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

\mjsdeqn

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

\mjsdeqn

D' = \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.

\mjsdeqn

t = \fracd_EC - d_CS\sqrtV_d_EC + V_d_CS

Where, the variance of \mjseqnd (\mjseqnV_d) is,

\mjsdeqn

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

\mjsdeqn

df = (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.

Shannon-Weaver and related indices

An index of information \mjseqnH, was described by \insertCiteshannon_mathematical_1949;textualEvaluateCore as follows.

\mjsdeqn

H = -\sum_i=1^kp_i \log_2(p_i)

\mjseqn

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

\mjsdeqn

H = -\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.

\mjsdeqn

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

\mjsdeqn

H' = \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.

\mjsdeqn

t = \fracH_EC - H_CS\sqrtV_H_EC + V_H_CS

Where, the variance of \mjseqnH (\mjseqnV_H) is,

\mjsdeqn

V_H = \frac\sum_i=1^kn_i(\log_2n_i)^2 \frac(\sum_i=1^k\log_2n_i)^2NN^2

\mjsdeqn\textrm

OR

\mjsdeqn

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

\mjsdeqn

df = \frac(V_H_EC + V_H_CS)^2\fracV_H_EC^2N_EC + \fracV_H_CS^2N_CS

McIntosh Diversity Index

A similar index of diversity was described by \insertCitemcintosh_index_1967;textualEvaluateCore as follows (\mjseqnD_Mc) \insertCitepeet_measurement_1974EvaluateCore.

\mjsdeqn

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

Testing for difference with bootstrapping

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.

\mjsdeqn

I_EC^* = \lbrace H_EC_1, H_EC_, \cdots, H_EC_R \rbrace

\mjsdeqn

I_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^*

\mjsdeqn

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

\mjsdeqn

z = \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.

\mjsdeqn

df = (k_EC - 1) + (k_CS - 1)

References

\insertAllCited

See Also

shannon, diversity, boot

Examples


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)



EvaluateCore documentation built on July 3, 2022, 5:06 p.m.