Class StatisticalAdjustment

java.lang.Object
gorsat.process.StatisticalAdjustment

public class StatisticalAdjustment extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    benjamini_hochberg(double[] pValues, double[] bh)
    Runs a Benjamini Hochberg correction on an ordered vector of p values.
    static void
    benjamini_yekutieli(double[] pValues, double[] by)
    Runs a Benjamini-Yekutieli correction on an ordered vector of p values.
    static double
    bonferroni(double pValue, int len)
     
    static double
    genomic_control_correct_p(double pValue, double invSqrtLambda)
     
    static double
    genomic_control_correct_z(double z, double invSqrtLambda)
    The genomic control corrected chi-2 statistic is computed by dividing the initial chi-2 statistic by lambda (the genomic inflation estimate).
    static double
    getInvSqrtLambda_p(double[] p)
    Returns 1 / sqrt(lambda) where lambda is the genomic inflation estimate.
    static void
    holm_bonferroni(double[] pValues, double[] holm)
    Runs a Holm-Bonferroni correction on an ordered vector of p values.
    static void
    invert(int[] perm)
    Inverts a permutation.
    static void
    sidak_sd(double[] pValues, double[] sidak)
    Runs a Sidak step down correction on an ordered vector of p values.
    static double
    sidak_ss(double pValue, int len)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • genomic_control_correct_z

      public static double genomic_control_correct_z(double z, double invSqrtLambda)
      The genomic control corrected chi-2 statistic is computed by dividing the initial chi-2 statistic by lambda (the genomic inflation estimate). If we have a z statistic > 0, then the corresponding the chi statistic is z^2. The correctied chi-statistic is z^2 / lambda so the corrected p-value is P(CHI_2(1) > z^2/lambda) = P(N(0,1) > z / sqrt(lambda) or N(0,1) < -z / sqrt(lambda)) = 2 * P(N(0,1) < -z / sqrt(lambda)) Which explains the formulas in the next two methods.
    • genomic_control_correct_p

      public static double genomic_control_correct_p(double pValue, double invSqrtLambda)
    • getInvSqrtLambda_p

      public static double getInvSqrtLambda_p(double[] p)
      Returns 1 / sqrt(lambda) where lambda is the genomic inflation estimate. The genomic inflation estimate is computed by taking the median of the chi stats (with 1 df) from which the p values are computed and dividing it by chi_inv_half. Let C be a CHI_2(1) random variable and N a N(0,1) random variable. Then C ~ N^2 so P(C > x^2) = P(N > |x| or N < -|x|) = 2 * P(N < -|x|). Thus, we can compute the chi-stats from the p values by normalInverse(p / 2)^2.
    • bonferroni

      public static double bonferroni(double pValue, int len)
    • holm_bonferroni

      public static void holm_bonferroni(double[] pValues, double[] holm)
      Runs a Holm-Bonferroni correction on an ordered vector of p values.
    • sidak_ss

      public static double sidak_ss(double pValue, int len)
    • sidak_sd

      public static void sidak_sd(double[] pValues, double[] sidak)
      Runs a Sidak step down correction on an ordered vector of p values.
    • benjamini_hochberg

      public static void benjamini_hochberg(double[] pValues, double[] bh)
      Runs a Benjamini Hochberg correction on an ordered vector of p values.
    • benjamini_yekutieli

      public static void benjamini_yekutieli(double[] pValues, double[] by)
      Runs a Benjamini-Yekutieli correction on an ordered vector of p values.
    • invert

      public static void invert(int[] perm)
      Inverts a permutation.