Class RegressionResult

java.lang.Object
edu.cmu.tetrad.regression.RegressionResult
All Implemented Interfaces:
TetradSerializable, Serializable

public class RegressionResult extends Object implements TetradSerializable
Stores the various components of a regression result so they can be passed around together more easily.
Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Constructor Details

    • RegressionResult

      public RegressionResult(boolean zeroInterceptAssumed, String[] regressorNames, int n, double[] b, double[] t, double[] p, double[] se, double r2, double rss, double alpha, Vector res)
      A result for a variety of regression algorithm.
      Parameters:
      zeroInterceptAssumed - True iff a zero intercept was assumed in doing the regression, in which case this coefficient is provided; otherwise, not.
      regressorNames - The list of regressor variable names, in order.
      n - The sample size.
      b - The list of coefficients, in order. If a zero intercept was not assumed, this list begins with the intercept.
      t - The list of t-statistics for the coefficients, in order. If a zero intercept was not assumed, this list begins with the t statistic for the intercept.
      p - The p-values for the coefficients, in order. If a zero intercept was not assumed, this list begins with the p value for the intercept.
      se - The standard errors for the coefficients, in order. If a zero intercept was not assumed, this list begins with the standard error of the intercept.
      r2 - The R squared statistic for the regression.
      rss - The residual sum of squares of the regression.
      alpha - The alpha value for the regression, determining which regressors are taken to be
      res - a Vector object
  • Method Details

    • serializableInstance

      public static RegressionResult serializableInstance()
      Generates a simple exemplar of this class to test serialization.
      Returns:
      a RegressionResult object
    • getN

      public int getN()

      Getter for the field n.

      Returns:
      the number of data points.
    • getNumRegressors

      public int getNumRegressors()

      getNumRegressors.

      Returns:
      the number of regressors.
    • getCoef

      public double[] getCoef()

      getCoef.

      Returns:
      the array of regression coeffients.
    • getT

      public double[] getT()

      Getter for the field t.

      Returns:
      the array of t-statistics for the regression coefficients.
    • getP

      public double[] getP()

      Getter for the field p.

      Returns:
      the array of p-values for the regression coefficients.
    • getSe

      public double[] getSe()

      Getter for the field se.

      Returns:
      an array of double objects
    • getRegressorNames

      public String[] getRegressorNames()

      Getter for the field regressorNames.

      Returns:
      an array of String objects
    • getPredictedValue

      public double getPredictedValue(double[] x)

      getPredictedValue.

      Parameters:
      x - an array of double objects
      Returns:
      a double
    • toString

      public String toString()

      toString.

      Overrides:
      toString in class Object
      Returns:
      a String object
    • getResultsTable

      public TextTable getResultsTable()

      getResultsTable.

      Returns:
      a TextTable object
    • getPreamble

      public String getPreamble()

      getPreamble.

      Returns:
      a String object
    • getResiduals

      public Vector getResiduals()

      getResiduals.

      Returns:
      a Vector object