The VARCOMP Procedure

Example 123.1 Using the Four General Estimation Methods

(View the complete code for this example.)

In this example, a and b are classification variables and y is the dependent variable. a is declared fixed, and b and a*b are random. Note that this design is unbalanced because the cell sizes are not all the same. PROC VARCOMP is invoked four times, once for each of the general estimation methods. The data are from Hemmerle and Hartley (1973). The following statements produce Output 123.1.1.

data a;
   input a b y @@;
   datalines;
1 1 237   1 1 254   1 1 246   1 2 178   1 2 179
2 1 208   2 1 178   2 1 187   2 2 146   2 2 145   2 2 141
3 1 186   3 1 183   3 2 142   3 2 125   3 2 136
;
proc varcomp method=type1 data=a;
   class a b;
   model y=a|b / fixed=1;
run;

Output 123.1.1: VARCOMP Procedure: Method=TYPE1

Variance Components Estimation Procedure

Class Level Information
ClassLevelsValues
a31 2 3
b21 2

Number of Observations Read16
Number of Observations Used16

Dependent Variable:y

Type 1 Analysis of Variance
SourceDFSum of SquaresMean SquareExpected Mean Square
a2117365868.218750Var(Error) + 2.725 Var(a*b) + 0.1 Var(b) + Q(a)
b11144811448Var(Error) + 2.6308 Var(a*b) + 7.8 Var(b)
a*b2299.041026149.520513Var(Error) + 2.5846 Var(a*b)
Error10786.33333378.633333Var(Error)
Corrected Total1524270  

Type 1 Estimates
Variance ComponentEstimate
Var(b)1448.4
Var(a*b)27.42659
Var(Error)78.63333


The "Class Level Information" table in Output 123.1.1 displays the levels of each variable specified in the CLASS statement. You can check this table to make sure the data are input correctly.

The Type I analysis of variance in Output 123.1.1 consists of a sequential partition of the total sum of squares. The mean square is the sum of squares divided by the degrees of freedom, and the expected mean square is the expected value of the mean square under the mixed model. The "Q" notation in the expected mean squares refers to a quadratic form in parameters of the parenthesized effect.

The Type I estimates of the variance components in Output 123.1.1 result from solving the linear system of equations established by equating the observed mean squares to their expected values.

The following statements are the same as before, except that the estimation method is MIVQUE0 instead of the default TYPE1. They produce Output 123.1.2.

proc varcomp method=mivque0 data=a;
   class a b;
   model y=a|b / fixed=1;
run;

Output 123.1.2: VARCOMP Procedure: Method=MIVQUE0

Variance Components Estimation Procedure

MIVQUE(0) SSQ Matrix
Sourceba*bErrory
b60.8400020.520007.8000089295.4
a*b20.5200020.520007.8000030181.3
Error7.800007.8000013.0000012533.5

MIVQUE(0) Estimates
Variance Componenty
Var(b)1466.1
Var(a*b)-35.49170
Var(Error)105.73660


The MIVQUE0 estimates in Output 123.1.2 result from solving the equations established by the MIVQUE0 SSQ matrix. Note that the estimate of the variance component for the interaction effect, Var(a*b), is negative for this example.

The following statements use METHOD=ML to invoke maximum likelihood estimation. They produce Output 123.1.3.

proc varcomp method=ml data=a;
   class a b;
   model y=a|b / fixed=1;
run;

Output 123.1.3: VARCOMP Procedure: Method=ML

Variance Components Estimation Procedure

Maximum Likelihood Iterations
IterationObjectiveVar(b) Var(a*b) Var(Error)
078.38503712001031.49070074.3909717935
178.2637043807732.3606453635077.4011688154
278.2635471161723.6867470850077.5301774839
378.2635471152723.6658365289077.5304926877

Convergence criteria met.

Maximum Likelihood Estimates
Variance ComponentEstimate
Var(b)723.66584
Var(a*b)0
Var(Error)77.53049

Asymptotic Covariance Matrix of Estimates
 Var(b)Var(a*b)Var(Error)
Var(b)537826.10-107.33905
Var(a*b)000
Var(Error)-107.339050858.71104


The "Maximum Likelihood Iterations" table in Output 123.1.3 shows that the Newton-Raphson algorithm used by PROC VARCOMP requires three iterations to converge.

The ML estimate of Var(a*b) is zero for this example, and the other two estimates are smaller than their Type I and MIVQUE0 counterparts.

One benefit of using likelihood-based methods is that an approximate covariance matrix is available from the matrix of second derivatives evaluated at the ML solution. This covariance matrix is valid asymptotically and can be unreliable in small samples.

Here the variance component estimates for B and the Error are negatively correlated, and the elements for Var(a*b) are set to zero because the estimate equals zero. Also, the very large variance for Var(b) indicates a lot of uncertainty about the estimate for Var(b), and one contributing explanation is that B has only two levels in this data set.

Finally, the following statements use the restricted maximum likelihood (REML) for estimation. They produce Output 123.1.4.

proc varcomp method=reml data=a;
   class a b;
   model y=a|b / fixed=1;
run;

Output 123.1.4: VARCOMP Procedure: Method=REML

Variance Components Estimation Procedure

REML Iterations
IterationObjectiveVar(b) Var(a*b) Var(Error)
063.41341449421269.52701091.5581191305
163.04468697871601.8419932.763241717476.9355562461
263.03115305081468.8293227.225818656178.7548276319
363.03112651481464.3364626.956405300378.8431476502
463.03112651271464.3672726.958852517778.8423898761

Convergence criteria met.

REML Estimates
Variance ComponentEstimate
Var(b)1464.4
Var(a*b)26.95885
Var(Error)78.84239

Asymptotic Covariance Matrix of Estimates
 Var(b)Var(a*b)Var(Error)
Var(b)4401703.81.29359-273.39651
Var(a*b)1.293593559.1-502.85157
Var(Error)-273.39651-502.851571249.7


The "REML Iterations" table in Output 123.1.4 shows that the REML optimization requires four iterations to converge.

The REML estimates in Output 123.1.4 are all larger than the corresponding ML estimates (adjusting for potential downward bias) and are fairly similar to the Type I estimates.

The "Asymptotic Covariance Matrix of Estimates" table in Output 123.1.4 shows that the Error variance component estimate is negatively correlated with the other two variance component estimates, and the estimated variances are all larger than their ML counterparts.