How to implement R's p.adjust in Python

后端 未结 7 1648
时光说笑
时光说笑 2020-12-12 22:39

I have a list of p-values and I would like to calculate the adjust p-values for multiple comparisons for the FDR. In R, I can use:

pval <- read.csv(\"my_f         


        
7条回答
  •  心在旅途
    2020-12-12 23:33

    If you wish to be sure of what you are getting from R, you can also indicate that you wish to use the function in the R package 'stats':

    from rpy2.robjects.packages import importr
    from rpy2.robjects.vectors import FloatVector
    
    stats = importr('stats')
    
    p_adjust = stats.p_adjust(FloatVector(pvalue_list), method = 'BH')
    

提交回复
热议问题