Diff for "FAQ/CombiningPvalues" - CBU statistics Wiki
location: Diff for "FAQ/CombiningPvalues"
Differences between revisions 1 and 2
Revision 1 as of 2008-02-11 16:38:46
Size: 159
Comment:
Revision 2 as of 2008-02-11 16:45:45
Size: 1060
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
The basic idea is that if $p_i (i=1 \ldots n)$ are the one-sided $p$-values for $n$ independent statistics The basic idea is that if $$p_i (i=1 \ldots n)$$ are the one-sided $$p$$-values for $$n$$ independent statistics then $$-2 \sum\log(p_i)$$ has is a $$\chi^2(2n)$$ statistic which reflects whether the combined $$p$$-values are smaller than would be expected if they were Uniform(0,1) variates.

The following MATLAB code evaluates this statistic and its p-value.


function p = pfast(p)
% Fisher's method for combination of independent p-values
    product=prod(p);
    n=length(p);
    if n<=0
        error('pfast was passed an empty array of p-values')
    elseif n==1
        p = product;
        return
    elseif product == 0
        p = 0;
        return
    else
        x = -log(product);
        t=product;
        p=product;
        for i = 1:n-1
            t = t * x / i;
            p = p + t;
        end
    end
Line 6: Line 31:
>> pvals=[0.1 0.01 0.01 0.7 0.3 0.1];
>> pfast(pvals)


ans =

    0.0021

I.e. the combined p-value is 0.0021 for this array of 6 $$p$$-values..

Combining p-values by Fisher's method

The basic idea is that if $$p_i (i=1 \ldots n)$$ are the one-sided $$p$$-values for $$n$$ independent statistics then $$-2 \sum\log(p_i)$$ has is a $$\chi^2(2n)$$ statistic which reflects whether the combined $$p$$-values are smaller than would be expected if they were Uniform(0,1) variates.

The following MATLAB code evaluates this statistic and its p-value.

function p = pfast(p) % Fisher's method for combination of independent p-values

  • product=prod(p); n=length(p);

    if n<=0

    • error('pfast was passed an empty array of p-values')
    elseif n==1
    • p = product; return
    elseif product == 0
    • p = 0; return
    else
    • x = -log(product); t=product; p=product; for i = 1:n-1
      • t = t * x / i; p = p + t;
      end
    end

>> pvals=[0.1 0.01 0.01 0.7 0.3 0.1]; >> pfast(pvals)

ans =

  • 0.0021

I.e. the combined p-value is 0.0021 for this array of 6 $$p$$-values..

None: FAQ/CombiningPvalues (last edited 2015-09-15 14:38:28 by PeterWatson)