/** * {@inheritDoc}<p> * This implementation uses the * {@link org.apache.commons.math.distribution.FDistribution * commons-math F Distribution implementation} to estimate the exact * p-value, using the formula<pre> * p = 1 - cumulativeProbability(F)</pre> * where <code>F</code> is the F value and <code>cumulativeProbability</code> * is the commons-math implementation of the F distribution.</p> * <p>True is returned iff the estimated p-value is less than alpha.</p> */ public boolean anovaTest(Collection categoryData, double alpha) throws IllegalArgumentException, MathException { if ((alpha <= 0) || (alpha > 0.5)) { throw new IllegalArgumentException("bad significance level: " + alpha); } return (anovaPValue(categoryData) < alpha); }
/** * {@inheritDoc}<p> * This implementation uses the * {@link org.apache.commons.math.distribution.FDistribution * commons-math F Distribution implementation} to estimate the exact * p-value, using the formula<pre> * p = 1 - cumulativeProbability(F)</pre> * where <code>F</code> is the F value and <code>cumulativeProbability</code> * is the commons-math implementation of the F distribution.</p> * <p>True is returned iff the estimated p-value is less than alpha.</p> */ public boolean anovaTest(Collection<double[]> categoryData, double alpha) throws IllegalArgumentException, MathException { if ((alpha <= 0) || (alpha > 0.5)) { throw MathRuntimeException.createIllegalArgumentException( LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL, alpha, 0, 0.5); } return anovaPValue(categoryData) < alpha; }
/** * {@inheritDoc}<p> * This implementation uses the * {@link org.apache.commons.math.distribution.FDistribution * commons-math F Distribution implementation} to estimate the exact * p-value, using the formula<pre> * p = 1 - cumulativeProbability(F)</pre> * where <code>F</code> is the F value and <code>cumulativeProbability</code> * is the commons-math implementation of the F distribution.</p> * <p>True is returned iff the estimated p-value is less than alpha.</p> */ public boolean anovaTest(Collection<double[]> categoryData, double alpha) throws IllegalArgumentException, MathException { if ((alpha <= 0) || (alpha > 0.5)) { throw MathRuntimeException.createIllegalArgumentException( "out of bounds significance level {0}, must be between {1} and {2}", alpha, 0, 0.5); } return anovaPValue(categoryData) < alpha; }
public IValue anovaPValue(IList categoryData){ try { return values.real(new OneWayAnovaImpl().anovaPValue(makeAnova(categoryData))); } catch (IllegalArgumentException e) { throw RuntimeExceptionFactory.illegalArgument(categoryData, null, null, e.getMessage()); } catch (MathException e) { throw RuntimeExceptionFactory.illegalArgument(categoryData, null, null, e.getMessage()); } }