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

    • serializableInstance

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

      public int getN()
      Returns:
      the number of data points.
    • getNumRegressors

      public int getNumRegressors()
      Returns:
      the number of regressors.
    • getCoef

      public double[] getCoef()
      Returns:
      the array of regression coeffients.
    • getT

      public double[] getT()
      Returns:
      the array of t-statistics for the regression coefficients.
    • getP

      public double[] getP()
      Returns:
      the array of p-values for the regression coefficients.
    • getSe

      public double[] getSe()
    • getRegressorNames

      public String[] getRegressorNames()
    • getPredictedValue

      public double getPredictedValue(double[] x)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getResultsTable

      public TextTable getResultsTable()
    • getPreamble

      public String getPreamble()
    • getResiduals

      public Vector getResiduals()