Analyzes a balanced complete experimental design for a fixed, random, or mixed model.
Required Arguments
NL — Vector of length NF containing the number of levels for each of the factors. (Input)
Y — Vector of length NL(1) *NL(2) *…*NL(NF) containing the responses. (Input) Y must not contain NaN (not a number) for any of its elements, i.e., missing values are not allowed.
NRF — For positive NRF, NRF is the number of random factors. (Input) For negative NRF, ‑NRF is the number of random effects (sources of variation).
INDRF — Index vector of length ∣NRF∣ containing either the factor numbers to be considered random (for NRF positive) or containing the effect numbers to be considered random (for NRF negative). (Input) If NRF = 0, INDRF is not referenced and can be a vector of length one.
NFEF — Vector of length NEF containing the number of factors associated with each effect in the model. (Input)
INDEF — Index vector of length NFEF(1) + NFEF(2) + … + NFEF(NEF). (Input) The first NFEF(1) elements give the factor numbers in the first effect. The next NFEF(2) elements give the the factor numbers in the second effect. The last NFEF(NEF) elements give the factor numbers in the last effect. Main effects must appear before their interactions. In general, an effect E cannot appear after an effect F if all of the indices for E appear also in F .
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
NF — Number of factors (number of subscripts) in the model, including error. (Input) Default: NF = size (NL,1).
NEF — Number of effects (sources of variation) due to the model excluding the overall mean and error. (Input) Default: NEF = size (NFEF,1).
CONPER — Confidence level for two-sided interval estimates on the variance components, in percent. (Input) CONPER percent confidence intervals are computed, hence, CONPER must be in the interval [0.0, 100.0). CONPER often will be 90.0, 95.0, or 99.0. For one-sided intervals with confidence level ONECL, ONECL in the interval [50.0, 100.0), set CONPER = 100.0 ‑ 2.0 * (100.0 ‑ONECL). Default: CONPER = 95.0.
Printing restricted to exclude marginal means higher than k ways. For example, only one-way and two-way marginal means will be printed if IPRINT = ‑2.
Let
The value of IPRINT must be between ‑n and 1, inclusively.
MODEL — Model Option. (Input) Default: MODEL = 0.
MODEL
Meaning
0
Searle model
1
Scheffe model
For the Scheffe model, effects corresponding to interactions of fixed and random factors have their sum over the subscripts corresponding to fixed factors equal to zero. Also, the variance of a random interaction effect involving some fixed factors has a multiplier for the associated variance component that involves the number of levels in the fixed factors. The Searle model has no summation restrictions on the random interaction effects and has a multiplier of one for each variance component.
EMS — Vector of length (NEF + 1) * (NEF + 2)/2 containing expected mean square coefficients. (Output) Suppose the effects are A, B, and AB. The ordering of the coefficients in EMS is as follows:
Error
AB
B
A
A
EMS(1)
EMS(2)
EMS(3)
EMS(4)
B
EMS(5)
EMS(6)
EMS(7)
AB
EMS(8)
EMS(9)
Error
EMS(10)
VC — NEF + 1 by 9 matrix containing statistics relating to the particular variance components or effects in the model and the error. (Output) Rows of VC correspond to the NEF effects plus error. Columns of VC are as follows:
Column
Description
1
Degrees of freedom
2
Sum of squares
3
Mean squares
4
F -statistic
5
p-value for F test
6
Variance component estimate
7
Percent of variance of y explained by random effect
8
Lower endpoint for a confidence interval on the variance component
9
Upper endpoint for a confidence interval on the variance component
Columns 6 through 9 contain NaN (not a number) if the effect is fixed, i.e., if there is no variance component to be estimated. If the variance component estimate is negative, columns 8 and 9 contain NaN.
LDVC — Leading dimension of VC exactly as specified in the dimension statement of the calling program. (Input) Deafult: LDVC = size( VC ,1).
YMEANS — Vector of length (NL(1) + 1) * (NL(2) + 1) *…* (NL(n) + 1) containing the subgroup means. (Output) Suppose the factors are A, B, and C. The ordering of the means is grand mean, A means, B means, C means, AB means, AC means, BC means, and ABC means.
FORTRAN 90 Interface
Generic: CALLABALD (NL, Y, NRF, INDRF, NFEF, INDEF, AOV[, …])
Specific: The specific interface names are S_ABALD and D_ABALD.
Routine ABALD analyzes a balanced complete experimental design for a fixed, random, or mixed model. The analysis includes an analysis of variance table, and computation of subgroup means and variance component estimates. A choice of two parameterizations of the variance components for the model can be made.
Scheffé (1959, pages 274‑289) discusses the parameterization for MODEL = 1. For example, consider the following model equation with fixed factor A and random factor B:
The fixed effects αi’s are subject to the restriction
the bj’s are random effects identically and independently distributed
cij are interaction effects each distributed
and are subject to the restrictions
and the eijk’s are errors identically and independently distributed N(0, σ2). In general, interactions of fixed and random factors have sums over subscripts corresponding to fixed factors equal to zero. Also in general, the variance of a random interaction effect is the associated variance component times a product of ratios for each fixed factor in the random interaction term. Each ratio depends on the number of levels in the fixed factor. In the earlier example, the random interaction AB has the ratio (a‑ 1)/a as a multiplier of
and
In a three-way crossed classification model, an ABC interaction effect with A fixed, B random, and C fixed would have variance
Searle (1971, pages 400‑401) discusses the parameterization for MODEL = 0. This parameterization does not have the summation restrictions on the effects corresponding to interactions of fixed and random factors. Also, the variance of each random interaction term is the associated variance component, i.e., without the multiplier. This parameterization is also used with unbalanced data, which is one reason for its popularity with balanced data also. In the earlier example,
Searle (1971, pages 400‑404) compares these two parameterizations. Hocking (1973) considers these different parameterizations and concludes they are equivalent because they yield the same variance-covariance structure for the responses. Differences in covariances for individual terms, differences in expected mean square coefficients and differences in F tests are just a consequence of the definition of the individual terms in the model and are not caused by any fundamental differences in the models. For the earlier two-way model, Hocking states that the relations between the two parameterizations of the variance components are
where
are the variance components in the parameterization with MODEL = 0.
The computations for degrees of freedom and sums of squares are the same regardless of the option specified by MODEL. ABALD first computes degrees of freedom and sum of squares for a full factorial design. Degrees of freedom for effects in the factorial design that are missing from the specified model are pooled into the model effect containing the fewest subscripts but still containing the factorial effect. If no such model effect exists, the factorial effect is pooled into error. If more than one such effect exists, a terminal error message is issued indicating a misspecified model.
The analysis of variance method is used for estimating the variance components. This method solves a linear system in which the mean squares are set to the expected mean squares. A problem that Hocking (1985, pages 324‑330) discusses is that this method can yield a negative variance component estimate. Hocking suggests a diagnostic procedure for locating the cause of the negative estimate. It may be necessary to re-examine the assumptions of the model.
The percentage of variation explained by each random effect is computed (output in VC(i, 7)) as the variance of the associated random effect divided by the variance of y. The two parameterizations can lead to different values because of the different definitions of the individual terms in the model. For example, the percentage associated with the AB interaction term in the earlier two-way mixed model is computed for MODEL = 1 using the formula
while for the parameterization MODEL = 0, the percentage is computed using the formula
In each case, the variance compenents are replaced by their estimates (stored in VC(i, 6)).
Confidence intervals on the variance components are computed using the method discussed by Graybill (1976, Theorem 15.3.5, page 624, and Note 4, page 620). Routine CIDMS is used.
Comments
Workspace may be explicitly provided, if desired, by use of A2ALD/DA2ALD. The reference is:
where yijk is the response for the k-th experimental unit in block j with treatment i; the αi’s are the treatment effects and are subject to the restriction
the bj’s are block effects identically and independently distributed
cij are interaction effects each distributed
and are subject to the restrictions
and the eijk’s are errors, identically and independently distributed N(0, σ2). The interaction effects are assumed to be distributed independently of the errors.
An analysis of a split-plot design is performed using data discussed by Milliken and Johnson (1984, Table 24.1, page 297). Label the two treatment factors A and C. Denote the treatment combination aick as that at the i-th level of A and the k-th level of C. The model is
yijk = μ + α i + bj + dij + δik + eijki = 1, 2; j = 1, 2; k = 1, 2, 3, 4
where yijk is the response for the j-th experimental unit with treatment combination aick; the αi’s are the effects due to treatment factor A, the bj’s are block effects identically and independently distributed
the dij are split plot errors that are identically and independently distributed
the k’s are the effects due to treatment factor C, the δik’s are interaction effects between factors A and C, and the eijk’s are identically and independently distributed N(0, σ2). The block effects, whole plot errors, and split plot errors are independent.
An analysis of a split-plot factorial design is performed using data discussed by Kirk (1982, Table 11.2-1, pages 493‑496). Label the two treatment factors A and C. Denote the treatment combination aick as that at the i-th level of A and the k-th level of C. The model is
where yijk is the response for the j-th experimental unit with treatment combination aick; the αi’s are the effects due to treatment factor A and are subject to the restriction
the bij’s are block effects identically and independently distributed
the k’s are the effects due to treatment factor C and are subject to the restriction
the δik’s are interaction effects between factors A and C and are subject to the restrictions
for each k, and
for each i, and the eijk’s are identically and independently distributed N(0, σ2). The block effects are assumed to be distributed independently of the errors.