# R/discoveries.R In sumSome: Permutation True Discovery Guarantee by Sum-Based Tests

#### Documented in discoveriesdiscoveries.sumObj

```#' @title Confidence Bound for the Number of True Discoveries
#' @description This function determines a lower confidence bound for the number of true discoveries
#' within a set of interest. The bound remains valid under post-hoc selection.
#' @usage discoveries(object)
#' @param object an object of class \code{sumObj}, as returned by
#' @return \code{discoveries} returns a lower (1-\code{alpha})-confidence bound
#' for the number of true discoveries in the set.
#' @author Anna Vesely.
#' @examples
#' # generate matrix of p-values for 5 variables and 10 permutations
#' G <- simData(prop = 0.6, m = 5, B = 10, alpha = 0.4, seed = 42)
#'
#' # subset of interest (variables 1 and 2)
#' S <- c(1,2)
#'
#' # create object of class sumObj
#' # combination: harmonic mean (Vovk and Wang with r = -1)
#' res <- sumPvals(G, S, alpha = 0.4, r = -1)
#' res
#' summary(res)
#'
#' # lower confidence bound for the number of true discoveries in S
#' discoveries(res)
#'
#' # lower confidence bound for the true discovery proportion in S
#' tdp(res)
#'
#' # upper confidence bound for the false discovery proportion in S
#' fdp(res)
#' @references
#' Goeman, J. J. and Solari, A. (2011). Multiple testing for exploratory research. Statistical Science, 26(4):584-597.
#'
#' Hemerik, J. and Goeman, J. J. (2018). False discovery proportion estimation by permutations: confidence for significance analysis of microarrays. JRSS B, 80(1):137-155.
#'
#' Vesely, A., Finos, L., and Goeman, J. J. (2020). Permutation-based true discovery guarantee by sum tests. Pre-print arXiv:2102.11759.
#' @seealso
#'
#' Lower confidence bound for the TDP: \code{\link{tdp}}
#'
#' Upper confidence bound for the FDP: \code{\link{fdp}}
#' @export

discoveries <- function(object){
UseMethod("discoveries")
}

#' @rdname discoveries
#' @export

discoveries.sumObj = function(object) {
return(object\$TD)
}
```

## Try the sumSome package in your browser

Any scripts or data that you put into this service are public.

sumSome documentation built on Nov. 24, 2021, 9:06 a.m.