|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectpapaya.OneWayAnova
public class OneWayAnova
Computes the one-way ANOVA p-value to test the equality of two or more sample
means by analyzing the sample variances using the test statistic
F = variance between samples / variance within samples.
Once initialized, the following values are computed and stored:
dfbg()).
ssbg()).
dfwg()).
sswg()).
F()).
pValue()).
Preconditions:
Collection must contain
float[] arrays.float[] arrays in the
categoryData collection and each of these arrays must
contain at least two values.This implementation is based on a description provided in Chapter 13 of the VassarStats
online textbook
Mean values are not computed directly in the algorithm as this tends to cause round-off error.
Rather, we use the more stable SumOfSquares - Sum^2:
Sum_(i=1 to n) (x_i - mean(x) )^2 = Sum_(i=1 to n)(x_i)^2 - (Sum_(i=1 to n) x_i)^2/n.
| Constructor Summary | |
|---|---|
OneWayAnova(Collection<float[]> categoryData)
Performs an Analysis of Variance (ANOVA) for a collection of float arrays. |
|
| Method Summary | |
|---|---|
int |
dfbg()
Returns the degrees of freedom between groups. |
int |
dfwg()
Returns the degrees of freedom within each group. |
float |
etasqrd()
Computes eta^2: a measure of the strength of the curvilinear relationship between the independent and dependent variable. |
float |
F()
Returns the test statistic F. |
float |
pValue()
Returns the significance, or "p-value" of the test statistic F(). |
float |
ssbg()
Returns the sum of squared deviates between each group. |
float |
sswg()
Returns the sum of squared deviates of the data within each group. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OneWayAnova(Collection<float[]> categoryData)
categoryData - the data coresponding to the different groupsCollection| Method Detail |
|---|
public float etasqrd()
public int dfbg()
public int dfwg()
public float F()
F = (ssbg/dfbg) / (sswg/dfwg);
public float pValue()
F().
That is,
p = 1 - Probability.fcdf(F,dfbg,dfwg);
public float sswg()
sswg = Sum_(i=1 to n1) (xi1-mean(x1))^2 + Sum_(i=1 to n2) (xi2-mean(xk))^2 + ... + Sum_(i=1 to nk) (xik-mean(xk))^2;
public float ssbg()
ssbg = Sum_(i=1 to k) (y_i)-mean(y))
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||