Class MetaAnalysis

java.lang.Object
ubic.basecode.math.metaanalysis.MetaAnalysis
Direct Known Subclasses:
CorrelationEffectMetaAnalysis, MeanDifferenceMetaAnalysis

public abstract class MetaAnalysis extends Object
Statistics for meta-analysis. Methods from Cooper and Hedges (CH); Hunter and Schmidt (HS).

In this class "conditional variance" means the variance for one data set. Unconditional means "between data set", or

Author:
Paul Pavlidis
  • Constructor Details

    • MetaAnalysis

      public MetaAnalysis()
  • Method Details

    • fisherCombinePvalues

      public static double fisherCombinePvalues(DoubleArrayList pvals)
      Fisher's method for combining p values. (Cooper and Hedges 15-8)
      Parameters:
      pvals - DoubleArrayList
      Returns:
      double upper tail
    • qTest

      public double qTest(double Q, double N)
      Test for statistical significance of Q.
      Parameters:
      Q - - computed using qStatistic
      N - - number of studies.
      Returns:
      The upper tail chi-square probability for Q with N - degrees of freedom.
      See Also:
    • fisherCombineLogPvalues

      protected double fisherCombineLogPvalues(DoubleArrayList pvals)
      Fisher's method for combining p values (Cooper and Hedges 15-8)

      Use for p values that have already been log transformed.

      Parameters:
      pvals - DoubleArrayList
      Returns:
      double upper tail
    • metaFEWeights

      protected DoubleArrayList metaFEWeights(DoubleArrayList variances)
      Weights under a fixed effects model. Simply w_i = 1/v_i. CH eqn 18-2.
      Parameters:
      variances -
      Returns:
    • metaRESampleVariance

      protected double metaRESampleVariance(DoubleArrayList effectSizes)
      CH sample variance under random effects model, equation 18-20
      Returns:
    • metaREVariance

      protected double metaREVariance(DoubleArrayList effectSizes, DoubleArrayList variances, DoubleArrayList weights)
      CH equation 18-23. Another estimator of the between-studies variance s2 for random effects model. This is non-zero only if Q is larger than expected under the null hypothesis that the variance is zero.
            sˆ2 = [Q - ( k - 1 ) ] / c
       
      where
            c = Max(sum_i=1ˆk w_i - [ sum_iˆk w_iˆ2 / sum_iˆk w_i ], 0)
       
      Parameters:
      effectSizes -
      variances -
      weights -
      Returns:
    • metaREWeights

      protected DoubleArrayList metaREWeights(DoubleArrayList variances, double sampleVariance)
      Under a random effects model, CH eqn. 18-24, we replace the conditional variance with the sum of the between-sample variance and the conditional variance.
            v_iˆ* = sigma-hat_thetaˆ2 + v_i.
       
      Parameters:
      variances - Conditional variances
      sampleVariance - estimated...somehow.
      Returns:
    • metaVariance

      protected double metaVariance(DoubleArrayList variances)
      CH 18-3. Can be used for fixed or random effects model, the variances just have to computed differently.
       
                  v_dot = 1/sum_i=1ˆk ( 1/v_i)
       
      Parameters:
      variances -
      Returns:
    • metaVariance

      protected double metaVariance(DoubleArrayList weights, DoubleArrayList qualityIndices)
      CH 18-3 version 2 for quality weighted. ( page 266 ) in Fixed effects model.
                  v_dot = [ sum_i=1ˆk ( q_i ˆ 2 * w_i) ]/[ sum_i=1ˆk  q_i * w_i ]ˆ2
       
      Parameters:
      variances -
      Returns:
    • metaZscore

      protected double metaZscore(double metaEffectSize, double metaVariance)
      Test statistic for H0: effectSize == 0. CH 18-5. For fixed effects model.
      Parameters:
      metaEffectSize -
      metaVariance -
      Returns:
    • qStatistic

      protected double qStatistic(DoubleArrayList effectSizes, DoubleArrayList variances, double globalMean)
      The "Q" statistic used to test homogeneity of effect sizes. (Cooper and Hedges 18-6)
      Parameters:
      effectSizes - DoubleArrayList
      variances - DoubleArrayList
      globalMean - double
      Returns:
      double
    • weightedMean

      protected double weightedMean(DoubleArrayList effectSizes, DoubleArrayList weights)
      General formula for weighted mean of effect sizes. Cooper and Hedges 18-1, or HS pg. 100.

      In HS, the weights are simply the sample sizes. For CH, the weights are 1/v for a fixed effect model. Under a random effects model, we would use 1/(v + v_bs) where v_bs is the between-studies variance.

      Parameters:
      effectSizes -
      sampleSizes -
      Returns:
    • weightedMean

      protected double weightedMean(DoubleArrayList effectSizes, DoubleArrayList weights, DoubleArrayList qualityIndices)
      General formula for weighted mean of effect sizes including quality index scores for each value. Cooper and Hedges 18-1, or HS pg. 100.
      Parameters:
      effectSizes -
      qualityIndices -
      sampleSizes -
      Returns: