Enum Class MissingDataPolicy

java.lang.Object
java.lang.Enum<MissingDataPolicy>
edu.cmu.tetrad.data.missing.MissingDataPolicy
All Implemented Interfaces:
Serializable, Comparable<MissingDataPolicy>, Constable

public enum MissingDataPolicy extends Enum<MissingDataPolicy>
An explicit statement of how missing values in a dataset are to be handled by a score, independence test, or search wrapper. The intent is to replace the current implicit behavior--in which, e.g., some scores silently switch to test-wise deletion when a dataset contains missing values--with a policy that the user chooses (or is at least warned about), and that every component either honors or rejects loudly.

The statistical assumptions differ by policy and matter for real-data analysis. Listwise and test-wise deletion are unbiased in general only when data are missing completely at random (MCAR). EM-estimated covariance and multiple imputation are valid under the weaker missing-at-random (MAR) assumption, for approximately multivariate normal data in the EM case. None of these policies corrects for missing-not-at-random (MNAR) mechanisms.

Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Estimate the mean and covariance matrix once by expectation-maximization under a saturated Gaussian model (see EmCovarianceEstimator) and run the analysis on the estimated covariance matrix as if it were complete data.
    Refuse to analyze data containing missing values; an exception should be thrown.
    Delete every row containing at least one missing value, once, up front, and analyze the remaining complete cases.
    Impute m completed datasets, run the analysis on each, and pool the results (for graph searches, by edge frequency across imputations).
    Estimate the covariance matrix once by pairwise deletion (see PairwiseCovarianceEstimator) and run the analysis on it as if it were complete data: each correlation from the rows complete on its pair, rescaled by each variable's standard deviation over all its observed rows, and shrunk toward the identity just enough to be positive definite.
    For each local score or independence test, use only the rows that are complete on the variables involved in that particular calculation.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether the policy estimates one covariance matrix from the incomplete data and analyzes it as complete data: EM_COVARIANCE or PAIRWISE_COVARIANCE.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • FAIL

      public static final MissingDataPolicy FAIL
      Refuse to analyze data containing missing values; an exception should be thrown. This is the safest default for components that have no principled way to handle missingness.
    • LISTWISE

      public static final MissingDataPolicy LISTWISE
      Delete every row containing at least one missing value, once, up front, and analyze the remaining complete cases. Unbiased only under MCAR; can discard a large fraction of the data when missingness is scattered.
    • TESTWISE

      public static final MissingDataPolicy TESTWISE
      For each local score or independence test, use only the rows that are complete on the variables involved in that particular calculation. This retains more data than listwise deletion but is still unbiased only under MCAR, and different local calculations are performed on different subsamples, which can produce inconsistencies (e.g., non-positive-definite implied covariances). This is the current implicit behavior of, e.g., SemBicScore when missing values are present.
    • EM_COVARIANCE

      public static final MissingDataPolicy EM_COVARIANCE
      Estimate the mean and covariance matrix once by expectation-maximization under a saturated Gaussian model (see EmCovarianceEstimator) and run the analysis on the estimated covariance matrix as if it were complete data. Valid under MAR for approximately multivariate normal data. Applies to continuous datasets and covariance-consuming scores/tests.
    • MULTIPLE_IMPUTATION

      public static final MissingDataPolicy MULTIPLE_IMPUTATION
      Impute m completed datasets, run the analysis on each, and pool the results (for graph searches, by edge frequency across imputations). Valid under MAR given a correctly specified imputation model; applicable to continuous, discrete, and mixed data.
    • PAIRWISE_COVARIANCE

      public static final MissingDataPolicy PAIRWISE_COVARIANCE
      Estimate the covariance matrix once by pairwise deletion (see PairwiseCovarianceEstimator) and run the analysis on it as if it were complete data: each correlation from the rows complete on its pair, rescaled by each variable's standard deviation over all its observed rows, and shrunk toward the identity just enough to be positive definite. Needs no model of the data, unlike EM_COVARIANCE, but is unbiased only under MCAR. Accepted by every component that accepts EM_COVARIANCE. Added after the other values, so their ordinals are unchanged.
  • Method Details

    • values

      public static MissingDataPolicy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MissingDataPolicy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • estimatesCovariance

      public boolean estimatesCovariance()
      Whether the policy estimates one covariance matrix from the incomplete data and analyzes it as complete data: EM_COVARIANCE or PAIRWISE_COVARIANCE. Components that consume a covariance matrix support both, getting the matrix from MissingDataUtils.estimateCovariance(edu.cmu.tetrad.data.DataSet, MissingDataSpec).
      Returns:
      True for EM_COVARIANCE and PAIRWISE_COVARIANCE.