P-Value adjustment for multiple comparisons: Difference between revisions
(Created page with "Having a set of p-valued and adjust them for multiple comparisons * Read the file in R: metab <- read.csv("sample.csv", header=F) <br> * Change the data to matrix and then...") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 14: | Line 14: | ||
For detailed information read: | For detailed information read: | ||
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: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