Shannonci: Confidence intervals for multiple contrasts of Shannon...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Calculates simultaneous and local confidence intervals for differences of Shannon indices under the assumption of multinomial count data.

Usage

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

Arguments

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

Details

This function implements confidence intervals described by Fritsch and Hsu (1999) for the difference of Shannon indices between several groups. Deviating from Fritsch and Hsu, quantiles of the multivariate normal distribution based on a plug-in-estamator for the correlation matrix.

Note, that this approach, by assuming multinomial distribution for the vectors of counts, ignores the variability of the individual samples. If such extra-multinomial variatio is present in the data, the intervals will be too narrow, coverage probability will be substantially lower than specified in 'conf.level'. Consider approaches based on bootstrap instead (e.g., package simboot).

Value

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

Author(s)

Frank Schaarschmidt

References

Fritsch, KS, and Hsu, JC (1999): Multiple Comparison of Entropies with Application to Dinosaur Biodiversity. Biometrics 55, 1300-1305. Scherer, R, Schaarschmidt, F, Prescher, S, and Priesnitz, KU (2013): Simultaneous confidence intervals for comparing biodiversity indices estimated from overdispersed count data. Biometrical Journal 55,246-263.

See Also

Simpsonci for simultaneous and local intervals of differences of the Simpson index

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
data(HCD)

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

# Comparison to the confidence bounds shown in
# Fritsch and Hsu (1999), Table 5, "Standard normal".

cmat<-rbind(
"HM-HU"=c(0,1,-1),
"HL-HM"=c(1,-1,0),
"HL-HU"=c(1,0,-1)
)

Shannonci(X=HCDcounts, f=HCDf, cmat=cmat,
 alternative = "two.sided", conf.level = 0.9, dist = "N")

# Note, that the calculated confidence intervals
# differ from those published by Fritsch and Hsu (1999),
# whenever Lower is involved.



# Comparison to the lower cretaceous,
# unadjusted confidence intervals:

Shannonci(X=HCDcounts, f=HCDf, type = "Dunnett",
 alternative = "greater", conf.level = 0.9, dist = "N")

# Stepwise comparison between the strata,
# unadjusted confidence intervals:

ShannonS<-Shannonci(X=HCDcounts, f=HCDf, type = "Sequen",
 alternative = "greater", conf.level = 0.9, dist = "N")


ShannonS

summary(ShannonS)

plot(ShannonS)


# 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<-Shannonci(X=HCDcounts, f=HCDf, cmat=cmatTREND,
 alternative = "greater", conf.level = 0.95, dist = "MVN")
TrendCI

plot(TrendCI)



  

MCPAN documentation built on May 1, 2019, 8:04 p.m.