public class ANOVA extends Object implements Serializable, Cloneable
Modifier and Type  Field and Description 

static int 
BONFERRONI
The Bonferroni method

static int 
DUNN_SIDAK
The DunnSidak method

static int 
ONE_AT_A_TIME
The OneataTime (Fisher's LSD) method

static int 
SCHEFFE
The Scheffe method

static int 
TUKEY
The Tukey method

static int 
TUKEY_KRAMER
The TukeyKramer method

Constructor and Description 

ANOVA(double[][] y)
/**
Analyzes a oneway classification model.

ANOVA(double dfr,
double ssr,
double dfe,
double sse,
double gmean)
Construct an analysis of variance table and related statistics.

Modifier and Type  Method and Description 

double 
getAdjustedRSquared()
Returns the adjusted Rsquared (in percent).

double[] 
getArray()
Returns the ANOVA values as an array.

double 
getCoefficientOfVariation()
Returns the coefficient of variation (in percent).

double[] 
getConfidenceInterval(double conLevel,
int i,
int j,
int compMethod)
Computes the confidence interval associated with the difference of means
between two groups using a specified method.

double 
getDegreesOfFreedomForError()
Returns the degrees of freedom for error.

double 
getDegreesOfFreedomForModel()
Returns the degrees of freedom for model.

double 
getErrorMeanSquare()
Returns the error mean square.

double 
getF()
Returns the F statistic.

double[][] 
getGroupInformation()
Returns information concerning the groups.

double 
getMeanOfY()
Returns the mean of the response (dependent variable).

double 
getModelErrorStdev()
Returns the estimated standard deviation of the model error.

double 
getModelMeanSquare()
Returns the model mean square.

double 
getP()
Returns the pvalue.

double 
getRSquared()
Returns the Rsquared (in percent).

double 
getSumOfSquaresForError()
Returns the sum of squares for error.

double 
getSumOfSquaresForModel()
Returns the sum of squares for model.

double 
getTotalDegreesOfFreedom()
Returns the total degrees of freedom.

int 
getTotalMissing()
Returns the total number of missing values.

double 
getTotalSumOfSquares()
Returns the total sum of squares.

public static final int BONFERRONI
public static final int DUNN_SIDAK
public static final int ONE_AT_A_TIME
public static final int SCHEFFE
public static final int TUKEY
public static final int TUKEY_KRAMER
public ANOVA(double[][] y)
y
 is a twodimension double
array containing the
responses. The rows in y
correspond to
observation groups. Each row of y
can
contain a different number of observations.public ANOVA(double dfr, double ssr, double dfe, double sse, double gmean)
dfr
 a double
scalar value representing
the degrees of freedom for model.ssr
 a double
scalar value representing the sum
of squares for model.dfe
 a double
scalar value representing the
degrees of freedom for error.sse
 a double
scalar value representing the sum
of squares for error.gmean
 a double
scalar value representing the
grand mean. If the grand mean is not known it may be
set to notanumber.public double getAdjustedRSquared()
double
scalar value representing the adjusted
Rsquared (in percent)public double[] getArray()
double
[15] array containing the following values:
index  Value 
0  Degrees of freedom for model 
1  Degrees of freedom for error 
2  Total degrees of freedom 
3  Sum of squares for model 
4  Sum of squares for error 
5  Total sum of squares 
6  Model mean square 
7  Error mean square 
8  F statistic 
9  pvalue 
10  Rsquared (in percent) 
11  Adjusted Rsquared (in percent) 
12  Estimated standard deviation of the model error 
13  Mean of the response (dependent variable) 
14  Coefficient of variation (in percent) 
public double getCoefficientOfVariation()
double
scalar value representing the coefficient
of variation (in percent)public double[] getConfidenceInterval(double conLevel, int i, int j, int compMethod)
getConfidenceInterval
computes the simultaneous
confidence interval on the pairwise comparison of means and in the oneway analysis of
variance model. Any of several methods can be chosen. A good review of
these methods is given by Stoline (1981). Also the methods are discussed
in many elementary statistics texts, e.g., Kirk (1982, pages 114127).
Let be the estimated variance of a single
observation. Let be the degrees of freedom
associated with . Let
Tukey method: The Tukey method gives the narrowest simultaneous confidence intervals for the pairwise differences of means in balanced oneway designs. The method is exact and uses the Studentized range distribution. The formula for the difference is given by
where is the percentage point of the Studentized range distribution with parameters and . If the group sizes are unequal, the TukeyKramer method is used instead.
TukeyKramer method: The TukeyKramer method is an approximate extension of the Tukey method for the unbalanced case. (The method simplifies to the Tukey method for the balanced case.) The method always produces confidence intervals narrower than the DunnSidak and Bonferroni methods. Hayter (1984) proved that the method is conservative, i.e., the method guarantees a confidence coverage of at least . Hayter's proof gave further support to earlier recommendations for its use (Stoline 1981). (Methods that are currently better are restricted to special cases and only offer improvement in severely unbalanced cases, see, e.g., Spurrier and Isham 1985). The formula for the difference is given by the following:
DunnSidak method: The DunnSidak method is a conservative method. The method gives wider intervals than the TukeyKramer method. (For large and small and k, the difference is only slight.) The method is slightly better than the Bonferroni method and is based on an improved Bonferroni (multiplicative) inequality (Miller, pages 101, 254255). The method uses the t distribution. The formula for the difference is given by
where is the 100f percentage point of the t distribution with degrees of freedom.
Bonferroni method: The Bonferroni method is a conservative method based on the Bonferroni (additive) inequality (Miller, page 8). The method uses the t distribution. The formula for the difference is given by
Scheffé method: The Scheffé method is an overly conservative method for simultaneous confidence intervals on pairwise difference of means. The method is applicable for simultaneous confidence intervals on all contrasts, i.e., all linear combinations
where the following is true:
The method can be recommended here only if a large number of confidence intervals on contrasts in addition to the pairwise differences of means are to be constructed. The method uses the F distribution. The formula for the difference is given by
where is the percentage point of the F distribution with and degrees of freedom.
Oneatatime t method (Fisher's LSD): The oneatatime t method is the method appropriate for constructing a single confidence interval. The confidence percentage input is appropriate for one interval at a time. The method has been used widely in conjunction with the overall test of the null hypothesis by the use of the F statistic. Fisher's LSD (least significant difference) test is a twostage test that proceeds to make pairwise comparisons of means only if the overall F test is significant. Milliken and Johnson (1984, page 31) recommend LSD comparisons after a significant F only if the number of comparisons is small and the comparisons were planned prior to the analysis. If many unplanned comparisons are made, they recommend Scheffe's method. If the F test is insignificant, a few planned comparisons for differences in means can still be performed by using either Tukey, TukeyKramer, DunnSidak or Bonferroni methods. Because the F test is insignificant, Scheffe's method will not yield any significant differences. The formula for the difference is given by
conLevel
 a double
specifying the confidence
level for simultaneous interval estimation. If the
Tukey method for computing the confidence intervals
on the pairwise difference of means is to be used,
conLevel
must be in the range [90.0,
99.0]. Otherwise, conLevel
must be in
the range i
 is an int
indicating the ith member of
the pair difference, .
i
must be a valid group index.j
 is an int
indicating the jth member of
the pair difference, .
j
must be a valid group index.compMethod
 must be one of the following:
compMethod  Description 
TUKEY  Uses the Tukey method. This method is valid for balanced oneway designs. 
TUKEY_KRAMER  Uses the TukeyKramer method. This method simplifies to the Tukey method for the balanced case. 
DUNN_SIDAK  Uses the DunnSidak method. 
BONFERRONI  Uses the Bonferroni method. 
SCHEFFE  Uses the Scheffe method. 
ONE_AT_A_TIME  Uses the OneataTime (Fisher's LSD) method. 
double
array containing the group numbers,
difference of means, and lower and upper confidence limits.
Array Element  Description 
0  Group number for the ith mean. 
1  Group number for the jth mean. 
2  Difference of means (ith mean)  (jth mean). 
3  Lower confidence limit for the difference. 
4  Upper confidence limit for the difference. 
public double getDegreesOfFreedomForError()
double
scalar value representing the degrees of
freedom for errorpublic double getDegreesOfFreedomForModel()
double
scalar value representing the degrees of
freedom for modelpublic double getErrorMeanSquare()
double
scalar value representing the error mean
squarepublic double getF()
double
scalar value representing the F statisticpublic double[][] getGroupInformation()
double
array containing information
concerning the groups. Row i contains information
pertaining to the ith group. The information in the
columns is as follows:
Column  Information 
0  Group Number 
1  Number of nonmissing observations 
2  Group Mean 
3  Group Standard Deviation 
public double getMeanOfY()
double
scalar value representing the mean of the
response (dependent variable)public double getModelErrorStdev()
double
scalar value representing the estimated
standard deviation of the model errorpublic double getModelMeanSquare()
double
scalar value representing the model mean
squarepublic double getP()
double
scalar value representing the
pvaluepublic double getRSquared()
double
scalar value representing the
Rsquared (in percent)public double getSumOfSquaresForError()
double
scalar value representing the sum of
squares for errorpublic double getSumOfSquaresForModel()
double
scalar value representing the sum of
squares for modelpublic double getTotalDegreesOfFreedom()
double
scalar value representing the total
degrees of freedompublic int getTotalMissing()
int
scalar value representing the total number
of missing values (NaN) in input Y. Elements of Y containing
NaN (not a number) are omitted from the computations.public double getTotalSumOfSquares()
double
scalar value representing the total sum of
squaresCopyright © 19702015 Rogue Wave Software
Built October 13 2015.