ABIBD
Analyzes a balanced incomplete block design or a balanced lattice design.
Required Arguments
NTRT — Number of treatments. (Input)
NREP — Number of replications. (Input)
NBLK — Number of blocks. (Input)
NTBLK — Number of treatments within each block. (Input)
NRESP — Number of responses within each treatment-block combination. (Input)
Y — Vector of length NBLK * NTBLK * NRESP containing the responses. (Input)
The first NRESP elements of Y contain the responses for the first treatment in the first block in the first replicate. The second NRESP elements of Y contain the responses for the second treatment in the first block in the first replicate. The NTBLK-th NRESP elements of Y contain the responses for the NTBLK-th treatment in the first block in the first replicate. The last NRESP elements of Y contain the responses for the NTBLK-th treatment in the NBLK-th block in the NREP-th replicate.
ITRT — Vector of length NBLK * NTBLK containing the treatment numbers for the responses in Y. (Input)
The treatment numbers must be from the set 1, 2, …, NTRT. For
I = 1, 2, …, NBLK * NTBLK, element numbers (I ‑ 1) * NRESP + 1 thru
(I ‑ 1) * NRESP + NRESP of Y correspond to treatment number ITRT(I).
AOV — Vector of length 15 containing statistics relating to the analysis of variance. (Output)
I |
AOV(I) |
1 |
Degrees of freedom for regression |
2 |
Degrees of freedom for error |
3 |
Total degrees of freedom |
4 |
Sum of squares for regression |
5 |
Sum of squares for error |
6 |
Total sum of squares |
7 |
Regression mean square |
8 |
Error mean square |
9 |
F-statistic |
10 |
p-value |
11 |
R2 (in percent) |
12 |
Adjusted R2 (in percent) |
13 |
Estimated standard deviation of the model error |
14 |
Mean of the response (dependent) variable |
15 |
Coefficient of variation (in percent) |
Optional Arguments
INTER — Interblock analysis option. (Input)
Default: INTER = 0.
INTER |
Means |
0 |
Intrablock analysis is requested. (Blocks are fixed effects.) |
1 |
Interblock analysis is requested. (Blocks are random effects.) |
IPRINT — Printing option. (Input)
Default: IPRINT = 0.
INTER |
Means |
0 |
No printing is performed. |
1 |
Print AOV, SQSS, and TESTLF (if NRESP > 1). |
2 |
Print YMEANS only. |
3 |
All printing is performed. |
SQSS — Vector of length 12 containing statistics relating to the sequential sum of squares for the model. (Output)
Elem. |
Description |
1, 2, 3 |
Degrees of freedom for replicates, blocks within replicates, and treatments (adjusted), respectively |
4, 5, 6 |
Sum of squares for replicates, blocks within replicates, and treatments (adjusted), respectively |
7, 8, 9 |
F -statistics for replicates, blocks, and treatments, respectively, computed using AOV(8) as the estimated error variance |
10‑12 |
p-values associated with the F -statistics |
SSALT — Vector of length 2 containing an alternative partitioning of the model sum of squares. (Output)
SSALT(1) is the treatment sum of squares (unadjusted) and SSALT(2) is the block sum of squares (adjusted).
TESTLF — Vector of length 10 containing statistics relating to the test for lack of fit of the model. (Output, if NRESP > 1)
If NRESP = 1, TESTLF is not referenced and can be a vector of length one. Elements of TESTLF are described as follows:
Elem |
Description |
1 |
Degrees of freedom for experimental error |
2 |
Degrees of freedom for within-cell error |
3 |
Degrees of freedom for error (TESTLF(1) + TESTLF(2)) |
4 |
Sum of squares for experimental error |
5 |
Sum of squares for within-cell error |
6 |
Sum of squares for error |
7 |
Mean square for experimental error |
8 |
Mean square for within-cell error |
9 |
F-statistic |
10 |
p-value |
YMEANS — Vector of length NREP + NBLK + NTRT + NTBLK * NBLK containing the replicate means, block by replicate means, treatment means (adjusted), and treatment by block means, respectively. (Output)
The treatment means (adjusted) in YMEANS are used for estimating treatment differences.
SETRTD — Estimated standard error of a treatment difference. (Output)
EFNCY — Estimated efficiency of this design relative to a randomized complete block design. (Output)
The randomized complete block design has NBLK * NTBLK/NTRT complete blocks.
FORTRAN 90 Interface
Generic: CALL ABIBD (NTRT, NREP, NBLK, NTBLK, NRESP, Y, ITRT, AOV [, …])
Specific: The specific interface names are S_ABIBD and D_ABIBD.
FORTRAN 77 Interface
Single: CALL ABIBD (NTRT, NREP, NBLK, NTBLK, NRESP, Y, ITRT, INTER, IPRINT, AOV, SQSS, SSALT, TESTLF, YMEANS, SETRTD, EFNCY)
Double: The double precision name is DABIBD.
Description
Routine ABIBD performs analyses for balanced incomplete block designs. The basic model used is the randomized block design with the source of variation for “blocks” subdivided into replications and blocks within replications. For INTER = 0, the model is
yijtm = μ + αi + βjj + δt + ɛ ijkm i = 1, …, r; j = 1, …, k; t = 1, …, p; m = 1, …, n
where the observed value of yijtm constitutes the m-th response with treatment t in block j within the i replicate, μ + α i + βij + δt is the population mean for the response, and the ɛijtm’s are independently distributed normal errors with mean zero and variance σ2. This model assumes the block effects and treatment effects are additive. Often in practice, there are interactions between the blocks and treatments. For this reason, ABIBD computes a test for nonadditivity (lack of fit), in addition to summary statistics for the additive model. This test requires at least two responses in each cell.
The analysis performed with the βij’s regarded as fixed effects in the model (INTER = 0) is called an “intrablock analysis.” For INTER = 1, the βij’s are assumed to be random effects in the model, the analysis performed for this mixed model is called an “interblock analysis.”
Routine ABIBD requires the yijtm’s to be entered in a single vector Y ordered lexicographically, so that the i subscript varies least rapidly, the j subscript the next most rapidly, and so forth. Formulas and interpretations for the analysis of balanced incomplete block designs are discussed by Anderson and Bancroft (1952, Chapters 19 and 24) and Kempthorne (1975, pages 532‑539).
Comments
Workspace may be explicitly provided, if desired, by use of A2IBD/DA2IBD. The reference is:
CALL A2IBD (NTRT, NREP, NBLK, NTBLK, NRESP, Y, ITRT, INTER, IPRINT, AOV, SQSS, SSALT, TESTLF, YMEANS, SETRTD, EFNCY, WK)
The additional argument is:
WK — Work vector of length NTRT or 2 * NTRT.
Example
This example performs an intrablock analysis for a balanced incomplete block design using data discussed by Anderson and Bancroft (1952, pages 254‑256). The responses are weight gains of rats fed p = 9 different rations. There are four replications with k = 3 blocks within each replicate. (Since p = k2, this balanced incomplete block design is a balanced lattice design.) The data with the treatment numbers in parentheses are given in the following table:
Replicate |
Block |
(Treatment): Weight Gain |
||
1 |
1 |
(1): 20 |
(4): 15 |
(7): 11 |
1 |
2 |
(3): 8 |
(6): 18 |
(9): 26 |
1 |
3 |
(2): 18 |
(5): 16 |
(8): 2 |
2 |
1 |
(7): 8 |
(8): 12 |
(9): 16 |
2 |
2 |
(1): 20 |
(2): 2 |
(3): 2 |
2 |
3 |
(4): 20 |
(5): 6 |
(6): 2 |
3 |
1 |
(1): 13 |
(9): 19 |
(5): 14 |
3 |
2 |
(8): 14 |
(4): 34 |
(3): 2 |
3 |
3 |
(6): 14 |
(2): 20 |
(7): 14 |
4 |
1 |
(5): 19 |
(7): 23 |
(3): 6 |
4 |
2 |
(1): 22 |
(6): 12 |
(8): 2 |
4 |
3 |
(9): 27 |
(2): 7 |
(4): 20 |
USE ABIBD_INT
IMPLICIT NONE
INTEGER NBLK, NREP, NRESP, NTBLK, NTRT
PARAMETER (NBLK=12, NREP=4, NRESP=1, NTBLK=3, NTRT=9)
!
INTEGER IPRINT, ITRT(NBLK*NTBLK)
REAL AOV(15), Y(NBLK*NTBLK*NRESP)
!
DATA Y/20.0, 15.0, 11.0, 8.0, 18.0, 26.0, 18.0, 16.0, 2.0, 8.0, &
12.0, 16.0, 20.0, 2.0, 2.0, 20.0, 6.0, 2.0, 13.0, 19.0, &
14.0, 14.0, 34.0, 2.0, 14.0, 20.0, 14.0, 19.0, 23.0, 6.0, &
22.0, 12.0, 2.0, 27.0, 7.0, 20.0/
DATA ITRT/1, 4, 7, 3, 6, 9, 2, 5, 8, 7, 8, 9, 1, 2, 3, 4, 5, 6, &
1, 9, 5, 8, 4, 3, 6, 2, 7, 5, 7, 3, 1, 6, 8, 9, 2, 4/
!
IPRINT = 3
CALL ABIBD (NTRT, NREP, NBLK, NTBLK, NRESP, Y, ITRT, &
AOV, IPRINT=IPRINT)
END
Output
Dependent R-squared Adjusted Est. Std. Dev. Coefficient of
Variable (percent) R-squared of Model Error Mean Var. (percent)
Y 79.771 55.748 5.345 14 38.18
* * * Analysis of Variance * * *
Sum of Mean Prob. of
Source DF Squares Square Overall F Larger F
Model 19 1802.8 94.88 3.321 0.0095
Error 16 457.2 28.57
Corrected Total 35 2260.0
* * * Decomposition of Variation Attributable to the Model * * *
Sum of Prob. of
Source DF Squares F Larger F
Replicates 3 219.6 2.561 0.0913
Blocks within
Replicates 8 127.1 0.556 0.7980
Treatments
(adjusted) 8 1456.1 6.370 0.0009
* * * Replicate means * * *
Replicate Mean (N=4)
1 14.8889
2 9.7778
3 16.0000
4 15.3333
* * * Block by Replicate Means * * *
Replicate Block Mean (N=3)
1 1 15.3333
1 2 17.3333
1 3 12.0000
2 1 12.0000
2 2 8.0000
2 3 9.3333
3 1 15.3333
3 2 16.6667
3 3 16.0000
4 1 16.0000
4 2 12.0000
4 3 18.0000
* * * Adjusted Treatment Means * * *
Treatment Mean (N=1)
1 22.11
2 11.67
3 0.67
4 23.89
5 14.78
6 11.11
7 12.89
8 6.44
9 22.44
* * * Treatment by Block Means * * *
Replicate Block Treatment Mean (N=1)
1 1 1 20.0000
1 1 4 15.0000
1 1 7 11.0000
1 2 3 8.0000
1 2 6 18.0000
1 2 9 26.0000
1 3 2 18.0000
1 3 5 16.0000
1 3 8 2.0000
2 1 7 8.0000
2 1 8 12.0000
2 1 9 16.0000
2 2 1 20.0000
2 2 2 2.0000
2 2 3 2.0000
2 3 4 20.0000
2 3 5 6.0000
2 3 6 2.0000
3 1 1 13.0000
3 1 9 19.0000
3 1 5 14.0000
3 2 8 14.0000
3 2 4 34.0000
3 2 3 2.0000
3 3 6 14.0000
3 3 2 20.0000
3 3 7 14.0000
4 1 5 19.0000
4 1 7 23.0000
4 1 3 6.0000
4 2 1 22.0000
4 2 6 12.0000
4 2 8 2.0000
4 3 9 27.0000
4 3 2 7.0000
4 3 4 20.0000