Class IndTestRegression

java.lang.Object
edu.cmu.tetrad.search.test.IndTestRegression
All Implemented Interfaces:
IndependenceTest

public final class IndTestRegression extends Object implements IndependenceTest
Checks independence of X _||_ Y | Z for variables X and Y and list Z of variables by regressing X on {Y} U Z and testing whether the coefficient for Y is zero.
Version:
$Id: $Id
Author:
josephramsey, Frank Wimberly
  • Constructor Details

    • IndTestRegression

      public IndTestRegression(DataSet dataSet, double alpha)
      Constructs a new Independence test which checks independence facts based on the correlation matrix implied by the given data set (must be continuous). The given significance level is used.
      Parameters:
      dataSet - A data set containing only continuous columns.
      alpha - The alpha level of the test.
  • Method Details

    • indTestSubset

      public IndependenceTest indTestSubset(List<Node> vars)
      Performs an independence test for a sublist of variables.
      Specified by:
      indTestSubset in interface IndependenceTest
      Parameters:
      vars - The sublist of variables.
      Returns:
      The independence test result.
    • checkIndependence

      public IndependenceResult checkIndependence(Node xVar, Node yVar, Set<Node> zList)
      Checks the independence between two variables, given a set of conditioning variables.
      Specified by:
      checkIndependence in interface IndependenceTest
      Parameters:
      xVar - The first variable to test for independence.
      yVar - The second variable to test for independence.
      zList - The set of conditioning variables.
      Returns:
      An IndependenceResult object containing the result of the independence test.
      See Also:
    • getAlpha

      public double getAlpha()
      Gets the getModel significance level.
      Specified by:
      getAlpha in interface IndependenceTest
      Returns:
      a double
    • setAlpha

      public void setAlpha(double alpha)
      Sets the significance level.
      Specified by:
      setAlpha in interface IndependenceTest
      Parameters:
      alpha - This level.
      Throws:
      IllegalArgumentException - if alpha is not within the range [0, 1].
    • getVariables

      public List<Node> getVariables()
      Returns the list of variables associated with this object.
      Specified by:
      getVariables in interface IndependenceTest
      Returns:
      the list of variables
    • toString

      public String toString()
      Returns a string representation of the Linear Regression Test object.
      Specified by:
      toString in interface IndependenceTest
      Overrides:
      toString in class Object
      Returns:
      the string representation of the Linear Regression Test object
    • determines

      public boolean determines(List<Node> zList, Node xVar)
      Determines if a variable xVar can be determined by a list of conditioning variables zList.
      Parameters:
      zList - The list of conditioning variables.
      xVar - The variable to test for determination.
      Returns:
      True if xVar is determined by zList, false otherwise.
      Throws:
      NullPointerException - if zList or any of its elements is null.
    • getData

      public DataSet getData()
      Returns the data used.
      Specified by:
      getData in interface IndependenceTest
      Returns:
      the data used.
      See Also:
    • isVerbose

      public boolean isVerbose()
      Returns true if the test prints verbose output.
      Specified by:
      isVerbose in interface IndependenceTest
      Returns:
      a boolean
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets whether this test will print verbose output.
      Specified by:
      setVerbose in interface IndependenceTest
      Parameters:
      verbose - True, if verbose output should be printed.