Package smile.stat.hypothesis
Class FTest
java.lang.Object
smile.stat.hypothesis.FTest
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.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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()
-
Field Details
-
df1
public final int df1The degree of freedom of F-statistic. -
df2
public final int df2The degree of freedom of F-statistic. -
f
public final double fF-statistic. -
pvalue
public final double pvaluep-value.
-
-
Constructor Details
-
FTest
public FTest(double f, int df1, int df2, double pvalue) Constructor.- Parameters:
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.
-
-
Method Details
-
toString
-
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.
-