View source: R/hierasymptkappa.R
1 | hierasymptkappa(pValues, alpha = 0.05, kappa = 0.001)
|
pValues |
|
alpha |
|
kappa |
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 61 62 63 64 65 66 | ##---- 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 (pValues, alpha = 0.05, kappa = 0.001)
{
result <- list()
if (is.list(pValues) == FALSE) {
fpValues <- sort(pValues)
m <- length(pValues)
u <- as.integer(kappa * m) + 1
conjpValues <- numeric()
for (i in 1:(m - u + 1)) {
locpvalue <- (fpValues[[(u - 1 + i)]] * (m - u +
1)/i)
conjpValues <- c(conjpValues, locpvalue)
}
fpvalue <- min(conjpValues)
if (fpvalue <= alpha * kappa) {
hresult <- aorc(pValues, alpha, startIDX_SUD = u,
betaAdjustment = 0, silent = TRUE)
result <- list(hresult)
}
else {
result <- (list(fpValues != fpValues))
}
}
else {
k <- length(pValues)
if ((1/k) <= kappa) {
kappa <- (1/k)
}
for (i in 1:k) {
if (length(pValues[[i]]) == 0) {
lresult <- list(FALSE)
result <- c(result, lresult)
next
}
fpValues <- pValues[[i]]
sortfpValues <- sort(fpValues)
fm <- length(fpValues)
fu <- as.integer(kappa * fm)
if (fu < (kappa * fm)) {
fu <- fu + 1
}
conjpValues <- numeric()
for (i in 1:(fm - fu + 1)) {
locpvalue <- (sortfpValues[[(fu - 1 + i)]] *
(fm - fu + 1)/i)
conjpValues <- c(conjpValues, locpvalue)
}
fpvalue <- min(conjpValues)
if (fpvalue <= (alpha * kappa)) {
lresult <- aorc(fpValues, alpha, startIDX_SUD = fu,
betaAdjustment = 0, silent = TRUE)
lresult <- list(lresult$rejected)
}
else {
lresult <- list(fpValues != fpValues)
}
result <- c(result, lresult)
}
}
return(result)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.