Package gorsat.process
Class StatisticalAdjustment
- java.lang.Object
-
- gorsat.process.StatisticalAdjustment
-
public class StatisticalAdjustment extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidbenjamini_hochberg(double[] pValues, double[] bh)Runs a Benjamini Hochberg correction on an ordered vector of p values.static voidbenjamini_yekutieli(double[] pValues, double[] by)Runs a Benjamini-Yekutieli correction on an ordered vector of p values.static doublebonferroni(double pValue, int len)static doublegenomic_control_correct_p(double pValue, double invSqrtLambda)static doublegenomic_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 doublegetInvSqrtLambda_p(double[] p)Returns 1 / sqrt(lambda) where lambda is the genomic inflation estimate.static voidholm_bonferroni(double[] pValues, double[] holm)Runs a Holm-Bonferroni correction on an ordered vector of p values.static voidinvert(int[] perm)Inverts a permutation.static voidsidak_sd(double[] pValues, double[] sidak)Runs a Sidak step down correction on an ordered vector of p values.static doublesidak_ss(double pValue, int len)
-
-
-
Method Detail
-
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.
-
-