Package smile.stat

Interface Hypothesis.t

Enclosing interface:
Hypothesis

public static interface Hypothesis.t
t-test.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static TTest
    test(double[] x, double mean)
    Independent one-sample t-test whether the mean of a normally distributed population has a value specified in a null hypothesis.
    static TTest
    test(double[] x, double[] y)
    Test if the arrays x and y have significantly different means.
    static TTest
    test(double[] x, double[] y, String option)
    Test if the arrays x and y have significantly different means.
    static TTest
    test(double r, int df)
    Test whether the Pearson correlation coefficient, the slope of a regression line, differs significantly from 0.
  • Method Details

    • test

      static TTest test(double[] x, double mean)
      Independent one-sample t-test whether the mean of a normally distributed population has a value specified in a null hypothesis. Small values of p-value indicate that the array has significantly different mean.
      Parameters:
      x - the sample values.
      mean - the mean.
      Returns:
      the test results.
    • test

      static TTest test(double[] x, double[] y)
      Test if the arrays x and y have significantly different means. The data arrays are assumed to be drawn from populations with unequal variances. Small values of p-value indicate that the two arrays have significantly different means.
      Parameters:
      x - the sample values.
      y - the sample values.
      Returns:
      the test results.
    • test

      static TTest test(double[] x, double[] y, String option)
      Test if the arrays x and y have significantly different means. Small values of p-value indicate that the two arrays have significantly different means.
      Parameters:
      x - the sample values.
      y - the sample values.
      option - "equal.var" if the data arrays are assumed to be drawn from populations with the same true variance. "unequal.var if the data arrays are allowed to be drawn from populations with unequal variances. "paired" if x and y are two values (i.e., a pair of values) for the same samples.
      Returns:
      the test results.
    • test

      static TTest test(double r, int df)
      Test whether the Pearson correlation coefficient, the slope of a regression line, differs significantly from 0. Small values of p-value indicate a significant correlation.
      Parameters:
      r - the Pearson correlation coefficient.
      df - the degree of freedom. df = n - 2, where n is the number of samples used in the calculation of r.
      Returns:
      the test results.