Class RegressionDataset

java.lang.Object
edu.cmu.tetrad.regression.RegressionDataset
All Implemented Interfaces:
Regression

public class RegressionDataset extends Object implements Regression
Implements a regression model from tabular continuous data.
Version:
$Id: $Id
Author:
josephramsey
  • Constructor Details

    • RegressionDataset

      public RegressionDataset(DataSet data)
      Constructs a linear regression model for the given tabular data set.
      Parameters:
      data - A rectangular data set, the relevant variables of which are continuous.
    • RegressionDataset

      public RegressionDataset(Matrix data, List<Node> variables)

      Constructor for RegressionDataset.

      Parameters:
      data - a Matrix object
      variables - a List object
  • Method Details

    • regress

      public static RegressionResult regress(double[] target, double[][] regressors)

      regress.

      Parameters:
      target - an array of double objects
      regressors - an array of double objects
      Returns:
      a RegressionResult object
    • setAlpha

      public void setAlpha(double alpha)
      Sets the significance level at which coefficients are judged to be significant.

      Sets the alpha level for deciding which regressors are significant based on their p values.

      Specified by:
      setAlpha in interface Regression
      Parameters:
      alpha - the significance level.
    • getGraph

      public Graph getGraph()

      Getter for the field graph.

      Specified by:
      getGraph in interface Regression
      Returns:
      This graph.
    • regress

      public RegressionResult regress(Node target, List<Node> regressors)
      Regresses the target on the given regressors.
      Specified by:
      regress in interface Regression
      Parameters:
      target - The target variable.
      regressors - The regressor variables.
      Returns:
      The regression plane, specifying for each regressors its coefficeint, se, t, and p values, and specifying the same for the constant.
    • regress

      public RegressionResult regress(Node target, Node... regressors)

      regress.

      Specified by:
      regress in interface Regression
      Parameters:
      target - a Node object
      regressors - a Node object
      Returns:
      a RegressionResult object
    • setRows

      public void setRows(int[] rows)

      Setter for the field rows.

      Parameters:
      rows - an array of int objects
    • getResidualsWithoutFirstRegressor

      public Vector getResidualsWithoutFirstRegressor()

      getResidualsWithoutFirstRegressor.

      Returns:
      a Vector object