P-Value adjustment for multiple comparisons: Difference between revisions

From Powers Wiki
(Added to Category)
No edit summary
 
Line 15: Line 15:
https://stat.ethz.ch/R-manual/R-devel/library/stats/html/p.adjust.html
https://stat.ethz.ch/R-manual/R-devel/library/stats/html/p.adjust.html


[[category:Protocols]]
[[category:Metabolomics]]
[[category:Data_Processing_and_Analysis]]
[[category:Data_Processing_and_Analysis]]

Latest revision as of 06:24, 20 January 2022

Having a set of p-valued and adjust them for multiple comparisons

  • Read the file in R:
   metab <- read.csv("sample.csv", header=F) 
  • Change the data to matrix and then to vector (N.B the p.adjust function only works with vector)
   metab <- data.matrix(metab)
   metab <- as.vector(metab)
  • Adjust the p-value: load the p-value and decide the method
   padj <- p.adjust(metab, method= "fdr")

N.B: The adjustment methods include the Bonferroni correction ("bonferroni") in which the p-values are multiplied by the number of comparisons. Less conservative correction are also included by Holm (1979) ("holm"), Hochberg (1988) ("hochberg"), Hommel (1988) ("hommel"), Benjamini & Hochberg (1995) ("BH" or its alias "fdr"), and Benjamini & Yekutieli (2001) ("BY"), respectively. A pass-through option ("none") is also included. The set of methods are contained in the p.adjust.methods vector for the benefit of methods that need to have the method as an option and pass it on to p.adjust.

For detailed information read: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/p.adjust.html