epsi.GG.HF {biology}R Documentation

~~function to do ... ~~

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

epsi.GG.HF(mat)

Arguments

mat ~~Describe mat here~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use

comp1 Description of 'comp1'
comp2 Description of 'comp2'

...

Warning

....

Note

~~further notes~~

~Make other sections like Warning with section{Warning }{....} ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--    or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (mat) 
{
    k <- ncol(mat)
    n <- nrow(mat)
    if (!is.data.frame(mat)) {
        list.len <- length(mat)
        S <- 0
        for (i in 1:list.len) {
            k <- ncol(mat[[i]])
            n <- nrow(mat[[i]])
            S <- S + (var(mat[[i]]) * (length(mat[[i]])/k))
        }
    }
    else {
        k <- ncol(mat)
        n <- nrow(mat)
        S <- var(mat)
    }
    D <- (k^2 * (mean(S) - mean(diag(S)))^2)
    N1 <- sum(S^2)
    N2 <- 2 * k * sum(apply(S, 1, mean)^2)
    N3 <- k^2 * mean(S)^2
    epsiGG <- D/((k - 1) * (N1 - N2 + N3))
    epsiHF <- (n * (k - 1) * epsiGG - 2)/((k - 1) * ((n - 1) - 
        (k - 1) * epsiGG))
    eps <- c(epsiGG, epsiHF)
    names(eps) <- c("GG epsilon", "HF epsilon")
    eps
  }

[Package biology version 1.0 Index]