G11BCF computes a marginal table from a table computed by
G11BAF or
G11BBF using a selected statistic.
SUBROUTINE G11BCF ( |
STAT, TABLE, NCELLS, NDIM, IDIM, ISDIM, STABLE, MAXST, MCELLS, MDIM, MLEVEL, AUXT, IWK, WK, IFAIL) |
INTEGER |
NCELLS, NDIM, IDIM(NDIM), ISDIM(NDIM), MAXST, MCELLS, MDIM, MLEVEL(NDIM), IWK(3*NDIM), IFAIL |
REAL (KIND=nag_wp) |
TABLE(NCELLS), STABLE(MAXST), AUXT(*), WK(NCELLS) |
CHARACTER(1) |
STAT |
|
For a dataset containing classification variables (known as factors) the routines
G11BAF and
G11BBF compute a table using selected statistics, for example the mean or the median. The table is indexed by the levels of the selected factors, for example if there were three factors A, B and C with
,
and
levels respectively and the mean was to be tabulated the resulting table would be
with each cell being the mean of all observations with the appropriate combination of levels of the three factors. In further analysis the table of means averaged over C for A and B may be required; this can be computed from the full table by taking the mean over the third dimension of the table, C.
In general, given a table computed by
G11BAF or
G11BBF, G11BCF computes a sub-table defined by a subset of the factors used to define the table such that each cell of the sub-table is the selected statistic computed over the remaining factors. The statistics that can be used are the total, the mean, the median, the variance, the smallest and the largest value.
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Only applicable when
. In this case a one pass algorithm is used as describe in
West (1979).
G11BCF is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The sub-tables created by G11BCF and stored in
STABLE and, depending on
STAT, also in
AUXT are stored in the following way. Let there be
dimensions defining the table with dimension
having
levels, then the cell defined by the levels
of the factors is stored in
th cell given by
where
The data, given by
John and Quenouille (1977), is for 3 blocks of a
factorial experiment. The data can be considered as a
table (i.e., blocks
treatment with
levels
treatment with
levels). This table is input and the
table of treatment means for over blocks is computed and printed.