Package smile.stat.hypothesis
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.
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
ConstructorDescriptionFTest
(double f, int df1, int df2, double pvalue) Creates an instance of aFTest
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
df1()
Returns the value of thedf1
record component.int
df2()
Returns the value of thedf2
record component.final boolean
Indicates whether some other object is "equal to" this one.double
f()
Returns the value of thef
record component.final int
hashCode()
Returns a hash code value for this object.double
pvalue()
Returns the value of thepvalue
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.toString()
Returns a string representation of this record class.
-
Constructor Details
-
FTest
public FTest(double f, int df1, int df2, double pvalue) Creates an instance of aFTest
record class.
-
-
Method Details
-
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. -
test
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
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. -
equals
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 '=='. -
f
public double f()Returns the value of thef
record component.- Returns:
- the value of the
f
record component
-
df1
public int df1()Returns the value of thedf1
record component.- Returns:
- the value of the
df1
record component
-
df2
public int df2()Returns the value of thedf2
record component.- Returns:
- the value of the
df2
record component
-
pvalue
public double pvalue()Returns the value of thepvalue
record component.- Returns:
- the value of the
pvalue
record component
-