Package ubic.basecode.math.metaanalysis
Class CorrelationEffectMetaAnalysis
java.lang.Object
ubic.basecode.math.metaanalysis.MetaAnalysis
ubic.basecode.math.metaanalysis.CorrelationEffectMetaAnalysis
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected double
fisherTransformedSamplingVariance
(double sampleSize) Equation 18-8 from CH.protected DoubleArrayList
fisherTransformedSamplingVariances
(DoubleArrayList sampleSizes) Run equation CH 18-8 on a list of sample sizes.double
getBsv()
double
getE()
double
getN()
double
getP()
double
getQ()
double
getV()
double
getZ()
double
run
(DoubleArrayList effects, DoubleArrayList sampleSizes) Following CH section 2.2.protected static double
samplingVariance
(double r, double numsamples) Equation 18-10 from CH.protected DoubleArrayList
samplingVariances
(DoubleArrayList effectSizes, DoubleArrayList sampleSizes) Run equation CH 18-10 on a list of sample sizes and effects.void
setFixed
(boolean fixed) void
setTransform
(boolean transform) Methods inherited from class ubic.basecode.math.metaanalysis.MetaAnalysis
fisherCombineLogPvalues, fisherCombinePvalues, metaFEWeights, metaRESampleVariance, metaREVariance, metaREWeights, metaVariance, metaVariance, metaZscore, qStatistic, qTest, weightedMean, weightedMean
-
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
Following CH section 2.2.There are four possible cases (for now):
- Fixed effects, Z-transformed. Weights are computed using CH eqns 18-8 and 18-3
- Fixed effects, untransformed. Weights are computed using CH eqns 18-10 and 18-3
- Random effects, Z-transformed. Weights are computed using CH eqns 18-20, 18-8 with 18-3
- Random effects, untransformed. Weights are computed using CH eqns 18-10, 18-20, 18-24.
- 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
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:
-