epsi.GG.HF {biology} | R Documentation |
~~ A concise (1-5 lines) description of what the function does. ~~
epsi.GG.HF(mat)
mat |
~~Describe mat here~~ |
~~ If necessary, more details than the description above ~~
~Describe the value returned If it is a LIST, use
comp1 |
Description of 'comp1' |
comp2 |
Description of 'comp2' |
...
....
~~further notes~~
~Make other sections like Warning with section{Warning }{....} ~
~~who you are~~
~put references to the literature/web site here ~
~~objects to See Also as help
, ~~~
##---- 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 }