Package 'hommel'

Title: Methods for Closed Testing with Simes Inequality, in Particular Hommel's Method
Description: Provides methods for closed testing using Simes local tests. In particular, calculates adjusted p-values for Hommel's multiple testing method, and provides lower confidence bounds for true discovery proportions. A robust but more conservative variant of the closed testing procedure that does not require the assumption of Simes inequality is also implemented. The methods have been described in detail in Goeman et al (2016) <arXiv:1611.06739v2>.
Authors: Jelle Goeman, Rosa Meijer, Thijmen Krebs
Maintainer: Jelle Goeman <[email protected]>
License: GPL (>= 2)
Version: 1.6
Built: 2024-12-10 06:30:45 UTC
Source: CRAN

Help Index


Methods for closed testing with Simes inequality, in particular Hommel's method

Description

Provides methods for closed testing using Simes local tests. In particular, calculates adjusted p-values for Hommel's multiple testing method, and provides lower confidence bounds for true discovery proportions. A robust but more conservative variant of the closed testing procedure that does not require the assumption of Simes inequality is also implemented.

Details

The starting point of the package is the hommel function. See examples there.

Author(s)

Jelle Goeman, Rosa Meijer, Thijmen Krebs.

Maintainer: Jelle Goeman <[email protected]>

References

Hommel, G. (1988). A stagewise rejective multiple test procedure based on a modified Bonferroni test. Biometrika, 75(2), 383-386.

Meijer, R., Krebs, T., Solari, A., & Goeman, J. (2016). Simultaneous Control of All False Discovery Proportions by an Extension of Hommel's Method. arXiv preprint arXiv:1611.06739.


Concentration set calculation

Description

Calculates the concentration set threshold. The concentration set is the subset of the p-values that contains all discoveries at confidence level 1-alpha.

Usage

concentration (hommel, alpha=0.05)

Arguments

hommel

The hommel object for the complete multiple testing problem.

alpha

The type I error allowed.

Value

Returns a p-value. P-values larger than that value contain no discoveries in this data set at this level of alpha and may be disregarded.

Author(s)

Jelle Goeman.

References

Goeman, J., Meijer, R., Krebs, T., & Solari, A. (2016). Simultaneous control of all false discovery proportions in large-scale multiple hypothesis testing. arXiv preprint arXiv:1611.06739.

Examples

#Generate a vector of pvalues
  set.seed(102)
  m <- 10
  pvalues <- c(runif(0.5*m,0,0.02), runif(0.5*m,0,1))
  
  # First step: create a hommel object.
  # Use Simes'test (simes = TRUE) or Hommel's robust test (simes = FALSE)
  hom <- hommel(pvalues, simes = TRUE)

  # Find the concentration set bound
  threshold <- concentration(hom)
  
  # Find the concentration set itself
  set <- pvalues <= threshold
  sum(set)

Calculates adjusted p-values of Hommel's method efficiently.

Description

Calculates adjusted p-values of Hommel's method efficiently.

Usage

hommel (p, simes = TRUE)

Arguments

p

A vector of p-values.

simes

If TRUE, the Simes test is used (Hommel's method), if FALSE Hommel's robust test is used.

Value

Returns a hommel-class object.

Author(s)

Jelle Goeman, Rosa Meijer, Thijmen Krebs.

References

Hommel, G. (1988). A stagewise rejective multiple test procedure based on a modified Bonferroni test. Biometrika, 75(2), 383-386.

Meijer, R. J., Krebs, T. J., & Goeman, J. J. (2019). Hommel's procedure in linear time. Biometrical Journal, 61(1), 73-82.

Goeman, J., Meijer, R., Krebs, T., & Solari, A. (2016). Simultaneous control of all false discovery proportions in large-scale multiple hypothesis testing. arXiv preprint arXiv:1611.06739.

Examples

#Generate a vector of pvalues
  set.seed(102)
  m <- 10
  pvalues <- c(runif(0.5*m,0,0.02), runif(0.5*m,0,1))
  
  # First step: create a hommel object.
  # Use Simes'test (simes = TRUE) or Hommel's robust test (simes = FALSE)
  hom <- hommel(pvalues, simes = TRUE)

  hom
  summary(hom)
  
  # retrieve familywise error adjusted p-values
  p.adjust(hom)
  
  # Find lower confidence bounds 
  # for the number of false null hypotheses (discoveries)
  # In any subset of interest
  discoveries(hom, 1:2)

Class "hommel" for storing the result of Hommel's multiple testing method.

Description

The class hommel is the output of a call to hommel. It stores the adjusted p-values of all elementary hypotheses, as well as information needed to quickly calculate other results about the underlying closed testing procedure.

Slots

These slots are not meant to be directly accessed by the user.

p:

Object of class "numeric". Stores original (unadjusted) p-values for all hypotheses.

sorter:

Object of class "integer". Stores the permutation to sort p.

jumpalpha:

Object of class "numeric". Stores the alpha-values where the function h jumps.

adjusted:

Object of class "numeric". Stores adjusted p-values for all elementary hypotheses.

simesfactor:

Object of class "numeric". The denominator of the local test that is used.

simes:

Object of class "logical". Is TRUE if the adjusted p-values are calculated based on Simes' test that assumes the Simes inequality. If FALSE if they are based on Hommel's robust test.

Methods

p.adjust

(hommel): Retrieves adjusted pvalues for all elementary hypotheses.

summary

(hommel, alpha=0.05): Summarizes the results of hommel's method for the specified level of alpha.

Author(s)

Jelle Goeman, Rosa Meijer, Thijmen Krebs.

References

Hommel, G. (1988). A stagewise rejective multiple test procedure based on a modified Bonferroni test. Biometrika, 75(2), 383-386.

Meijer, R. J., Krebs, T. J., & Goeman, J. J. (2019). Hommel's procedure in linear time. Biometrical Journal, 61(1), 73-82.

Goeman, J., Meijer, R., Krebs, T., & Solari, A. (2016). Simultaneous control of all false discovery proportions in large-scale multiple hypothesis testing. arXiv preprint arXiv:1611.06739.

See Also

select, concentration.

Examples

#Generate a vector of pvalues
  set.seed(102)
  m <- 10
  pvalues <- c(runif(0.5*m,0,0.02), runif(0.5*m,0,1))
  
  # First step: create a hommel object.
  # Use Simes'test (simes = TRUE) or Hommel's robust test (simes = FALSE)
  hom <- hommel(pvalues, simes = TRUE)

  hom
  summary(hom)
  
  # retrieve familywise error adjusted p-values
  p.adjust(hom)
  
  # Find lower confidence bounds 
  # for the number of false null hypotheses (discoveries)
  # In any subset of interest
  discoveries(hom, 1:2)

P-values and adjusted p-values of local tests

Description

An intersection hypothesis is defined for any collection of null hypotheses as the hypothesis that is true if and only if the proportion of null hypotheses are less than the selected threshold. A test for an intersection hypothesis is called a local test. This function calculates familywise error adjusted p-values for local tests. Familywise error control is over all possible local tests simultaneously.

Usage

localtest (hommel, ix, tdp)

Arguments

hommel

The hommel object for the complete multiple testing problem.

ix

The selection of hypotheses defining the intersection hypothesis. Any selector that works on the original vector of p-values (index, negative index, logical, names) is allowed. If ix is missing, the global null hypothesis is used.

tdp

The threshold value for the intersection hypothesis which should be a proportion.

Value

Returns the familywise error adjusted p-value.

Author(s)

Jelle Goeman.

References

Meijer, R. J., Krebs, T. J., & Goeman, J. J. (2019). Hommel's procedure in linear time. Biometrical Journal, 61(1), 73-82.

Goeman, J., Meijer, R., Krebs, T., & Solari, A. (2016). Simultaneous control of all false discovery proportions in large-scale multiple hypothesis testing. arXiv preprint arXiv:1611.06739.

Examples

#Generate a vector of pvalues
  set.seed(102)
  m <- 10
  pvalues <- c(runif(0.5*m,0,0.02), runif(0.5*m,0,1))

  # First step: create a hommel object.
  hom <- hommel(pvalues, simes = TRUE)

  # Test any intersection hypothesis of interest against any chosen threshold
  localtest(hom, tdp=0.2)
  localtest(hom, 1:3, 0.8)

Confidence bounds for the number of discoveries

Description

Calculates (1-alpha) lower confidence bounds for the number of false null hypotheses (discoveries) or for the true discovery proportion, and (1-alpha) upper confidence bounds for the false discovery proportions. These bounds are for arbitrary subsets, and are simultaneous over all subsets. They are valid even if the subset is chosen after seeing the data.

Usage

discoveries (hommel, ix, incremental=FALSE, alpha=0.05) 
  fdp (hommel, ix, incremental=FALSE, alpha=0.05) 
  tdp (hommel, ix, incremental=FALSE, alpha=0.05)

Arguments

hommel

The hommel object for the complete multiple testing problem.

ix

The selection of hypotheses considered. Any selector that works on the original vector of p-values (index, negative index, logical, names) is allowed. If missing, all hypotheses are selected.

incremental

If TRUE, the number of discoveries (of fdp or tdp) is reported for incremental sets formed by adding the indices from ix in order. If FALSE, reports the numbr of discoveries in the full set only.

alpha

The type I error allowed.

Value

Returns a single integer (discoveries) or proportion (fdp, tdp), or a vector if incremental = TRUE. These represent the lower confidence bound (discoveries, tdp) or upper confidence bound (fdp). The confidence intervals are one-sided: the upper confidence bound for discoveries is the size of the set, and for tdp 1. The lower bound for fdp is 0.

Author(s)

Jelle Goeman, Rosa Meijer, Thijmen Krebs, Mitra Ebrahimpoor, Xu Chen.

References

Goeman, J., Meijer, R., Krebs, T., & Solari, A. (2016). Simultaneous control of all false discovery proportions in large-scale multiple hypothesis testing. arXiv preprint arXiv:1611.06739.

Examples

#Generate a vector of pvalues
  set.seed(102)
  m <- 10
  pvalues <- c(runif(0.5*m,0,0.02), runif(0.5*m,0,1))
  
  # First step: create a hommel object.
  # Use Simes'test (simes = TRUE) or Hommel's robust test (simes = FALSE)
  hom <- hommel(pvalues, simes = TRUE)

  hom
  summary(hom)
  
  # Find lower confidence bounds 
  # for the number of false null hypotheses (discoveries)
  # In any subset of interest
  discoveries(hom, 1:2)
  
  # a bound for the false discovery proportion:
  set <- 1:5
  fdp(hom, set)
  
  # or incremental for sets ix = (1), (1,2), (1,2,3), (1,2,3,4) and (1,2,3,4,5)
  fdp(hom, set, incremental = TRUE)
  
  # use alpha=0.5 to obtain a conservative point estimate
  tdp(hom, set, alpha=0.5)