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) arrayInput
-
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: – IntegerInput
-
On entry: , the total number of observations.
- 3: – IntegerInput
-
On entry: , the number of groups.
Constraint:
.
- 4: – Integer arrayInput
-
On entry: the number of subgroups within group
, , for .
Constraint:
, for .
- 5: – Integer arrayInput
-
On entry: the numbers of observations in each subgroup,
, in the following order:
Constraint:
, that is and , for .
- 6: – IntegerInput
-
On entry: , the total number of subgroups.
Constraint:
.
- 7: – Integer arrayOutput
-
On exit: the total number of observations in group
, , for .
- 8: – Real (Kind=nag_wp) arrayOutput
-
On exit: the mean for group
, , for .
- 9: – Real (Kind=nag_wp) arrayOutput
-
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) arrayOutput
-
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 arrayOutput
-
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) arrayOutput
-
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) arrayOutput
-
On exit: contains the significances of the mean square ratios, and respectively.
- 15: – IntegerInput/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this argument, the recommended value is
.
When the value 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).