Class CorrelationEffectMetaAnalysis

java.lang.Object
ubic.basecode.math.metaanalysis.MetaAnalysis
ubic.basecode.math.metaanalysis.CorrelationEffectMetaAnalysis

public class CorrelationEffectMetaAnalysis extends MetaAnalysis
Implementation of meta-analysis of correlations along the lines of chapter 18 of Cooper and Hedges, "Handbook of Research Synthesis". Both fixed and random effects models are supported, with z-transformed or untransformed correlations.
Author:
pavlidis
  • Constructor Details

    • CorrelationEffectMetaAnalysis

      public CorrelationEffectMetaAnalysis()
    • CorrelationEffectMetaAnalysis

      public CorrelationEffectMetaAnalysis(boolean fixed, boolean transform)
  • Method Details

    • samplingVariance

      protected static double samplingVariance(double r, double numsamples)
      Equation 18-10 from CH. For untransformed correlations.

       v_i = ( 1 - r_i ˆ 2 ) ˆ 2 / ( n_i - 1 )
       

      I added a regularization to this, so that we don't get ridiculous variances when correlations are close to 1 (this happens). If the correlation is very close to 1 (or -1), we fudge it to be a value less close to 1 (e.g., 0.999)

      Parameters:
      r -
      n -
      Returns:
    • getBsv

      public double getBsv()
    • getE

      public double getE()
    • getN

      public double getN()
    • getP

      public double getP()
    • getQ

      public double getQ()
    • getV

      public double getV()
    • getZ

      public double getZ()
    • run

      public double run(DoubleArrayList effects, DoubleArrayList sampleSizes)
      Following CH section 2.2.

      There are four possible cases (for now):

      1. Fixed effects, Z-transformed. Weights are computed using CH eqns 18-8 and 18-3
      2. Fixed effects, untransformed. Weights are computed using CH eqns 18-10 and 18-3
      3. Random effects, Z-transformed. Weights are computed using CH eqns 18-20, 18-8 with 18-3
      4. Random effects, untransformed. Weights are computed using CH eqns 18-10, 18-20, 18-24.
      The default is untransformed, fixed effects.
      Parameters:
      sampleSizes -
      correlations - - NOT fisher transformed. This routine takes care of that.
      Returns:
      p-value. The p-value is also stored in the field p.
    • setFixed

      public void setFixed(boolean fixed)
    • setTransform

      public void setTransform(boolean transform)
    • fisherTransformedSamplingVariance

      protected double fisherTransformedSamplingVariance(double sampleSize)
      Equation 18-8 from CH. For z-transformed correlations.
       v_i = 1 / ( n_i - 3 )
       
      Parameters:
      n -
      Returns:
    • fisherTransformedSamplingVariances

      protected DoubleArrayList fisherTransformedSamplingVariances(DoubleArrayList sampleSizes)
      Run equation CH 18-8 on a list of sample sizes.
      Parameters:
      sampleSizes -
      Returns:
    • samplingVariances

      protected DoubleArrayList samplingVariances(DoubleArrayList effectSizes, DoubleArrayList sampleSizes)
      Run equation CH 18-10 on a list of sample sizes and effects.
      Parameters:
      effectSizes -
      sampleSizes -
      Returns:
      See Also: