p值校正


https://www.jianshu.com/p/16d160afd140

https://www.cnblogs.com/wangprince2017/p/9937341.html

p.adjust {stats}

Adjust P-values for Multiple Comparisons

Description

Given a set of p-values, returns p-values adjusted using one of several methods.

Usage

p.adjust(p, method = p.adjust.methods, n = length(p))

 

Arguments

p: numeric vector of p-values (possibly with NAs). Any other R object is coerced by as.numeric.

method: correction method. Can be abbreviated.p.adjust.methods # c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY",  "fdr", "none")

n: number of comparisons, must be at least length(p); only set this (to non-default) when you know what you are doing!

Details

The adjustment methods include the Bonferroni correction ("bonferroni") in which the p-values are multiplied by the number of comparisons. Less conservative corrections 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.

The first four methods are designed to give strong control of the family-wise error rate. There seems no reason to use the unmodified Bonferroni correction because it is dominated by Holm's method, which is also valid under arbitrary assumptions.

Hochberg's and Hommel's methods are valid when the hypothesis tests are independent or when they are non-negatively associated (Sarkar, 1998; Sarkar and Chang, 1997). Hommel's method is more powerful than Hochberg's, but the difference is usually small and the Hochberg p-values are faster to compute.

The "BH" (aka "fdr") and "BY" method of Benjamini, Hochberg, and Yekutieli control the false discovery rate, the expected proportion of false discoveries amongst the rejected hypotheses. The false discovery rate is a less stringent condition than the family-wise error rate, so these methods are more powerful than the others.

Note that you can set n larger than length(p) which means the unobserved p-values are assumed to be greater than all the observed p for "bonferroni" and "holm" methods and equal to 1 for the other methods.

Value

A numeric vector of corrected p-values (of the same length as p, with names copied from p).

 

该函数表达的意思是这样的:

  1. 我们将一系列p值、校正方法(BH)以及所有p值的个数(length(p))输入到p.adjust函数中。
  2. 将一系列的p值按照从大到小排序,然后利用下述公式计算每个p值所对应的FDR值。 公式:p * (n/i), p是这一次检验的p value,n是检验的次数,i是排序后的位置ID(如最大的P值的i值肯定为n,第二大则是n-1,依次至最小为1)。
  3. 将计算出来的FDR值赋予给排序后的p值,如果某一个p值所对应的FDR值大于前一位p值(排序的前一位)所对应的FDR值,则放弃公式计算出来的FDR值,选用与它前一位相同的值。因此会产生连续相同FDR值的现象;反之则保留计算的FDR值。
  4. 将FDR值按照最初始的p值的顺序进行重新排序,返回结果。

 

STAMP中多重检验的p值校正

 Benjamini   属于FWER α值除以检验次数,太严格,一般不用

 Benjamini-Hochberg FDR 应用较多

Storey’s FDR

Sidak

 

如何理解Family-wise error rate(FWER)和False discovery rate(FDR)

https://www.sohu.com/a/165109778_785442

http://www.360doc.com/content/18/0914/21/19913717_786724085.shtml

https://zhuanlan.zhihu.com/p/26229438

假设检验是用于检验统计假设的一种方法。它的基本思想是小概率思想,小概率思想是指小概率事件在一次试验中基本上不会发生。

一次检验有四种可能的结果,会犯两类错误,

I类错误(α )弃真:是指空假设为真却被我们拒绝的情况,犯这种错误的概率用α表示

II类错误(β)取伪:是指空假设为假但我们没有拒绝的情况,犯这种错误的概率用β表示

 

在做假设检验时,只控制I类错误,即α。

 

多重假设检验就是(同一数据集下)进行多次假设检验。举个例子,一台大米包装机,正常工作时生产的袋装大米的质量符合正态分布,某次质检员抽一袋称重,判断机器是否正常运行。

如果有抽m台机器,那么就需要进行m次假设检验。

在一次假设检验中,我们使用显著性水平α或p值得出结论,可以保证一次假设检验中犯I类错误的概率和决策错误的风险小于α。

但是在 m次假设检验中,假设检验之间相互独立,站在质检员角度(multiple test),检验结果错误(至少1次错误)的概率增大,远大于α,站在每台机器的角度(single test),I类错误仍然是α 。

所以,对于多重检验,如果不进行任何控制,犯一类错误的概率便会随着假设检验的个数迅速增加。

为了使多重假设检验整体犯I类错误的概率低于预先设定的显著性水平α ,往往采用FWER和FDR校正。


FWER和FDR表示一种概念或一种方法,FWER定义为多重假设检验中发现至少一个I类错误的概率,FDR定义为多重假设检验中错误发现占所有发现的比例(弃真/弃真+取伪)。另外,对应地,还存在FWER校正方法和FDR校正方法(也称为控制方法)。两类校正方法都是用来控制多重假设检验中犯I类错误的概率,使其低于显著性水平α。FWER校正有多种实现,其中最经典的是Bonferroni correction;FDR校正也有多种实现,其中最经典的就是Benjamini–Hochberg procedure。

FWER显得较为保守,它主要是依靠减少假阳性的个数,同时也会减少TDR(true discovery rate)。

Bonferroni correction  只要pi ≤α/m ,就拒绝Hi​

FDR方法是一种更加新颖靠谱的方法,它会对每个测试用例使用校正后的p 值,达到了更好的效果:在检验出尽可能多的阳性结果的同时将错误发现率控制在可以接受的范围。

BH进行了p值排序,它校正有效的条件是要求m个检验是相互独立的。

 

总体错误率(family wise error rate,FWER)定义为至少犯一次I型错误的概率。常用的总体错误率控制程序包括Bonferroni、Holm、Hochberg和Hommel等方法,但总体错误率控制过于严格,并不适合大规模数据的多重比较,随着检验次数m的增加,总体错误率的效能明显降低。

错误发现率(False Discovery Rate, FDR)是错误拒绝(拒绝真的原假设)的个数占所有被拒绝的原假设个数的比例的期望值。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM