Record Class FTest

java.lang.Object
java.lang.Record
smile.stat.hypothesis.FTest
Record Components:
f - the F-statistic.
df1 - the first degree of freedom of F-statistic.
df2 - the second degree of freedom of F-statistic.
pvalue - the p-value.

public record FTest(double f, int df1, int df2, double pvalue) extends Record
F test of the hypothesis that two independent samples come from normal distributions with the same variance, against the alternative that they come from normal distributions with different variances. Note that the F-test is extremely non-robust to non-normality. That is, even if the data displays only modest departures from the normal distribution, the test is unreliable and should not be used.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FTest(double f, int df1, int df2, double pvalue)
    Creates an instance of a FTest record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    df1()
    Returns the value of the df1 record component.
    int
    df2()
    Returns the value of the df2 record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
    f()
    Returns the value of the f record component.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the pvalue record component.
    static FTest
    test(double[] x, double[] y)
    Test if the arrays x and y have significantly different variances.
    static FTest
    test(int[] x, double[] y)
    One-way analysis of variance (ANOVA) between a categorical independent variable (with two or more categories) and a normally distributed interval dependent variable to test for differences in the means of the dependent variable broken down by the levels of the independent variable.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FTest

      public FTest(double f, int df1, int df2, double pvalue)
      Creates an instance of a FTest record class.
      Parameters:
      f - the value for the f record component
      df1 - the value for the df1 record component
      df2 - the value for the df2 record component
      pvalue - the value for the pvalue record component
  • Method Details

    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • test

      public static FTest test(double[] x, double[] y)
      Test if the arrays x and y have significantly different variances. Small values of p-value indicate that the two arrays have significantly different variances.
      Parameters:
      x - the sample values.
      y - the sample values.
      Returns:
      the test results.
    • test

      public static FTest test(int[] x, double[] y)
      One-way analysis of variance (ANOVA) between a categorical independent variable (with two or more categories) and a normally distributed interval dependent variable to test for differences in the means of the dependent variable broken down by the levels of the independent variable. Treat the variances in the samples as equal.
      Parameters:
      x - the categorical independent variable.
      y - the normally distributed interval dependent variable.
      Returns:
      the test results.
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • f

      public double f()
      Returns the value of the f record component.
      Returns:
      the value of the f record component
    • df1

      public int df1()
      Returns the value of the df1 record component.
      Returns:
      the value of the df1 record component
    • df2

      public int df2()
      Returns the value of the df2 record component.
      Returns:
      the value of the df2 record component
    • pvalue

      public double pvalue()
      Returns the value of the pvalue record component.
      Returns:
      the value of the pvalue record component