In a two-way hierarchical classification, there are
(
) treatment groups, the
th of which is subdivided into
treatment subgroups. The
th subgroup of group
contains
observations, which may be denoted by
The general observation is denoted by
, being the
th observation in subgroup
of group
, for
,
,
.
The following quantities are computed
-
(i)The subgroup means
-
(ii)The group means
-
(iii)The grand mean
-
(iv)The number of observations in each group
-
(v)Sums of squares
-
(vi)Degrees of freedom of variance components
Between groups: |
|
Subgroups within groups: |
|
Residual: |
|
Total: |
|
where
-
(vii) ratios. These are the ratios of the group and subgroup mean squares to the residual mean square.
Groups |
|
Subgroups |
|
If either ratio exceeds , the value is assigned instead.
-
(viii)f significances. The probability of obtaining a value from the appropriate -distribution which exceeds the computed mean square ratio.
Groups |
|
Subgroups |
|
where denotes the central -distribution with degrees of freedom and .
If any , then is set to zero, .
-
1:
– Real (Kind=nag_wp) array
Input
-
On entry: the elements of
y must contain the observations
in the following order:
In words, the ordering is by group, and within each group is by subgroup, the members of each subgroup being in consecutive locations in
y.
-
2:
– Integer
Input
-
On entry: , the total number of observations.
-
3:
– Integer
Input
-
On entry: , the number of groups.
Constraint:
.
-
4:
– Integer array
Input
-
On entry: the number of subgroups within group
, , for .
Constraint:
, for .
-
5:
– Integer array
Input
-
On entry: the numbers of observations in each subgroup,
, in the following order:
Constraint:
, that is and , for .
-
6:
– Integer
Input
-
On entry: , the total number of subgroups.
Constraint:
.
-
7:
– Integer array
Output
-
On exit: the total number of observations in group
, , for .
-
8:
– Real (Kind=nag_wp) array
Output
-
On exit: the mean for group
, , for .
-
9:
– Real (Kind=nag_wp) array
Output
-
On exit: the subgroup means,
, in the following order:
-
10:
– Real (Kind=nag_wp)
Output
-
On exit: the grand mean, .
-
11:
– Real (Kind=nag_wp) array
Output
-
On exit: contains the sums of squares for the analysis of variance, as follows;
- Between group sum of squares, ,
- Between subgroup within groups sum of squares, ,
- Residual sum of squares, ,
- Corrected total sum of squares, .
-
12:
– Integer array
Output
-
On exit: contains the degrees of freedom attributable to each sum of squares in the analysis of variance, as follows:
- Degrees of freedom for between group sum of squares,
- Degrees of freedom for between subgroup within groups sum of squares,
- Degrees of freedom for residual sum of squares,
- Degrees of freedom for corrected total sum of squares.
-
13:
– Real (Kind=nag_wp) array
Output
-
On exit: contains the mean square ratios, and , for the between groups variation, and the between subgroups within groups variation, with respect to the residual, respectively.
-
14:
– Real (Kind=nag_wp) array
Output
-
On exit: contains the significances of the mean square ratios, and respectively.
-
15:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
or
to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value
or
is recommended. If message printing is undesirable, then the value
is recommended. Otherwise, the value
is recommended.
When the value or is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
The computations are believed to be stable.
This example has two groups, the first of which consists of five subgroups, and the second of three subgroups. The numbers of observations in each subgroup are not equal. The data represent the percentage stretch in the length of samples of sack kraft drawn from consignments (subgroups) received over two years (groups). For details see
Moore et al. (1972).