Class PooledRankTest

java.lang.Object
edu.cmu.tetrad.search.rlcd.PooledRankTest
All Implemented Interfaces:
RankTester

public final class PooledRankTest extends Object implements RankTester
The RLCD rank test over several imputations of one data set with missing values: each question RLCD asks is answered once, from all of the imputations, instead of once per imputation.

The statistic of Chi2RankTest is computed on each of the M imputed data sets, giving d_1, ..., d_M, each referred by that test to a chi-square distribution with k degrees of freedom. These are combined by the rule of Li, Meng, Raghunathan, and Rubin (1991, Statistica Sinica 1, 65-92) for chi-square statistics from multiply imputed data, often called D2:

    r  = (1 + 1/M) · Var(√d_1, ..., √d_M)                  (sample variance, divisor M − 1)
    D2 = ( mean(d)/k − ((M + 1)/(M − 1)) · r ) / (1 + r)
    ν  = k^(−3/M) · (M − 1) · (1 + 1/r)²
with D2 referred to an F distribution with k and ν degrees of freedom. Here r estimates the relative increase in variance due to the missing values: where the imputations agree, r is near zero and the rule reduces to the ordinary chi-square test on the mean statistic; where they disagree, the statistic is shrunk and the reference distribution widened, so the disagreement counts against rejecting.

This is not the same as pooling independent data sets. The imputations share their observed values, so combining their p-values as if they were independent (Fisher's method), or adding their scores, would count the same rows M times.

What is and is not established: the rule is a standard approximation, derived assuming proper imputations under data missing at random and a common fraction of missing information across the parameters tested. It is known to be rough, with few imputations especially, and no calibration result is claimed for its use with the Lawley corrected rank statistic. Tetrad's imputers draw from a fitted model without redrawing the model's parameters (improper imputation), which understates r somewhat.

Author:
josephramsey
  • Constructor Summary

    Constructors
    Constructor
    Description
    PooledRankTest(List<DataSet> imputations)
    Constructs the test from the imputed data sets.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    failToReject(int[] pcols, int[] qcols, int r, double alpha)
    Tests the null hypothesis that the cross-covariance of columns pcols and qcols has rank at most r.
    int
    Returns the number of imputed data sets being pooled.
    static double
    pooledPValue(double[] d, int df)
    Combines chi-square statistics from M imputations by the D2 rule; see the class comment.
    double
    pValue(int[] pcols, int[] qcols, int r)
    The pooled p-value of the rank ≤ r test.
    double
    relativeIncreaseInVariance(int[] pcols, int[] qcols, int r)
    The relative increase in variance due to the missing values, as estimated for one test: the r of the class comment.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PooledRankTest

      public PooledRankTest(List<DataSet> imputations)
      Constructs the test from the imputed data sets.
      Parameters:
      imputations - continuous data sets with the same variables in the same order and the same number of rows; at least one.
  • Method Details

    • getNumImputations

      public int getNumImputations()
      Returns the number of imputed data sets being pooled.
      Returns:
      the number of imputations pooled.
    • failToReject

      public boolean failToReject(int[] pcols, int[] qcols, int r, double alpha)
      Description copied from interface: RankTester
      Tests the null hypothesis that the cross-covariance of columns pcols and qcols has rank at most r.
      Specified by:
      failToReject in interface RankTester
      Parameters:
      pcols - column indices of the first set.
      qcols - column indices of the second set.
      r - the hypothesized maximum rank.
      alpha - the significance level.
      Returns:
      true if the null is NOT rejected (rank deficiency is consistent with the data), false if rejected.
    • pValue

      public double pValue(int[] pcols, int[] qcols, int r)
      The pooled p-value of the rank ≤ r test.
      Specified by:
      pValue in interface RankTester
      Parameters:
      pcols - column indices of the first set.
      qcols - column indices of the second set.
      r - the hypothesized maximum rank.
      Returns:
      the p-value, or 0 when the degrees of freedom are not positive.
    • relativeIncreaseInVariance

      public double relativeIncreaseInVariance(int[] pcols, int[] qcols, int r)
      The relative increase in variance due to the missing values, as estimated for one test: the r of the class comment. Zero with a single imputation.
      Parameters:
      pcols - column indices of the first set.
      qcols - column indices of the second set.
      r - the hypothesized maximum rank.
      Returns:
      the estimate.
    • pooledPValue

      public static double pooledPValue(double[] d, int df)
      Combines chi-square statistics from M imputations by the D2 rule; see the class comment.
      Parameters:
      d - the statistics, one per imputation.
      df - their common degrees of freedom; positive.
      Returns:
      the pooled p-value.