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.
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)
  • Method Details

    • regress

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

      public void setAlpha(double alpha)
      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()
      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)
      Description copied from interface: Regression
      Regresses target on the regressors, yielding a regression plane.
      Specified by:
      regress in interface Regression
      Parameters:
      target - the target variable, being regressed.
      regressors - the list of variables being regressed on.
      Returns:
      the regression plane.
    • setRows

      public void setRows(int[] rows)
    • getResidualsWithoutFirstRegressor

      public Vector getResidualsWithoutFirstRegressor()