Package edu.cmu.tetrad.search.test
Class IndTestRegression
java.lang.Object
edu.cmu.tetrad.search.test.IndTestRegression
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionIndTestRegression
(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). -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence
(Node xVar, Node yVar, Set<Node> zList) Checks the independence between two variables, given a set of conditioning variables.boolean
determines
(List<Node> zList, Node xVar) Determines if a variable xVar can be determined by a list of conditioning variables zList.double
getAlpha()
Gets the getModel significance level.getData()
Returns the data used.Returns the list of variables associated with this object.indTestSubset
(List<Node> vars) Performs an independence test for a sublist of variables.boolean
Returns true if the test prints verbose output.void
setAlpha
(double alpha) Sets the significance level.void
setVerbose
(boolean verbose) Sets whether this test will print verbose output.toString()
Returns a string representation of the Linear Regression Test object.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.cmu.tetrad.search.IndependenceTest
checkIndependence, determines, getCov, getDataSets, getSampleSize, getVariable, getVariableNames
-
Constructor Details
-
IndTestRegression
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
Performs an independence test for a sublist of variables.- Specified by:
indTestSubset
in interfaceIndependenceTest
- Parameters:
vars
- The sublist of variables.- Returns:
- The independence test result.
-
checkIndependence
Checks the independence between two variables, given a set of conditioning variables.- Specified by:
checkIndependence
in interfaceIndependenceTest
- 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 interfaceIndependenceTest
- Returns:
- a double
-
setAlpha
public void setAlpha(double alpha) Sets the significance level.- Specified by:
setAlpha
in interfaceIndependenceTest
- Parameters:
alpha
- This level.- Throws:
IllegalArgumentException
- if alpha is not within the range [0, 1].
-
getVariables
Returns the list of variables associated with this object.- Specified by:
getVariables
in interfaceIndependenceTest
- Returns:
- the list of variables
-
toString
Returns a string representation of the Linear Regression Test object.- Specified by:
toString
in interfaceIndependenceTest
- Overrides:
toString
in classObject
- Returns:
- the string representation of the Linear Regression Test object
-
determines
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
Returns the data used.- Specified by:
getData
in interfaceIndependenceTest
- Returns:
- the data used.
- See Also:
-
isVerbose
public boolean isVerbose()Returns true if the test prints verbose output.- Specified by:
isVerbose
in interfaceIndependenceTest
- Returns:
- a boolean
-
setVerbose
public void setVerbose(boolean verbose) Sets whether this test will print verbose output.- Specified by:
setVerbose
in interfaceIndependenceTest
- Parameters:
verbose
- True, if verbose output should be printed.
-