The HPMIXED Procedure

Example 56.2 Comparing Results from PROC HPMIXED and PROC MIXED

(View the complete code for this example.)

This example revisits the mixed model problem from the section Getting Started: MIXED Procedure, in Chapter 78: The MIXED Procedure, with the data set shown in the following statements:

data heights;
   input Family Gender$ Height @@;
   datalines;
1 F 67   1 F 66   1 F 64   1 M 71   1 M 72   2 F 63
2 F 63   2 F 67   2 M 69   2 M 68   2 M 70   3 F 63
3 M 64   4 F 67   4 F 66   4 M 67   4 M 67   4 M 69
;

The response variable Height measures the heights (in inches) of 18 individuals. The individuals are classified according to Family and Gender. The following statements fit a mixed model with random effects for Family and the Family*Gender interaction with the MIXED procedure:

proc mixed;
   class Family Gender;
   model Height = Gender / s;
   random Family Family*Gender / s;
run;

The "Iteration History" and "Fit Statistics" tables for the optimization in PROC MIXED are shown in Output 56.2.1. The MIXED procedure converges after six iterations and achieves a –2 restricted log likelihood of 71.02246.

Output 56.2.1: Iteration History and Fit Statistics: MIXED Procedure

The Mixed Procedure

Iteration History
IterationEvaluations-2 Res Log LikeCriterion
0174.11074833 
1271.516140030.01441208
2171.138459900.00412226
3171.036135560.00058188
4171.022817570.00001689
5171.022459040.00000002
6171.022458690.00000000

Fit Statistics
-2 Res Log Likelihood71.0
AIC (Smaller is Better)77.0
AICC (Smaller is Better)79.0
BIC (Smaller is Better)75.2


Output 56.2.2 displays the covariance parameter estimates and the solutions for the fixed and random effects. Because the fixed-effect model contains a classification effect (Gender) and an intercept, the matrix is singular. Only two fixed-effect parameters can be estimated in this model. The MIXED procedure, relying on a sweep operation in the order in which effects enter the model, determines that the last column of the matrix is a linear function of previous columns. Consequently, the coefficient for the second level of the Gender variable is zero.

Output 56.2.2: Parameter Estimates and Solutions: MIXED Procedure

Covariance Parameter Estimates
Cov ParmEstimate
Family2.4010
Family*Gender1.7657
Residual2.1668

Solution for Fixed Effects
EffectGenderEstimateStandard
Error
DFt ValuePr > |t|
Intercept 68.21141.1477359.43<.0001
GenderF-3.36211.19233-2.820.0667
GenderM0....

Solution for Random Effects
EffectGenderFamilyEstimateStd Err PredDFt ValuePr > |t|
Family 11.26801.1201101.130.2840
Family 20.089801.1121100.080.9372
Family 3-1.66601.171210-1.420.1853
Family 40.30821.1201100.280.7888
Family*GenderF1-0.31981.081010-0.300.7734
Family*GenderM11.25231.0933101.150.2787
Family*GenderF2-0.42991.077410-0.400.6983
Family*GenderM20.49591.0774100.460.6551
Family*GenderF3-0.082291.140910-0.070.9439
Family*GenderM3-1.14291.140910-1.000.3401
Family*GenderF40.83201.0933100.760.4642
Family*GenderM4-0.60531.081010-0.560.5878


The "Type 3 Tests of Fixed Effects" table in Output 56.2.3 is produced by the MIXED procedure by default.

Output 56.2.3: Test of Gender Effect

Type 3 Tests of Fixed Effects
EffectNum DFDen DFF ValuePr > F
Gender137.950.0667


The same linear mixed model is fit with the HPMIXED procedure with the following statements:

proc hpmixed;
   class Family Gender;
   model Height = Gender / s;
   random Family Family*Gender / s;
   test gender;
run;

Output 56.2.4 displays the "Iteration History" and "Fit Statistics" tables. The HPMIXED procedure, with its default quasi-Newton algorithm, achieves the same –2 restricted log likelihood as the MIXED procedure (71.02246; see Output 56.2.1).

Output 56.2.4: Iteration History and Fit Statistics: HPMIXED Procedure

The HPMIXED Procedure

Iteration History
IterationEvaluationsObjective
Function
ChangeMax
Gradient
0471.023177956.0.034074
1371.0225199360.000658020.007839
2371.0224772830.000042650.004674
3271.02245870.000018580.000168
4271.0224586890.000000013.28E-6

Fit Statistics
-2 Res Log Likelihood71.02246
AIC (Smaller is Better)77.02246
AICC (Smaller is Better)79.02246
BIC (Smaller is Better)75.18134
CAIC (Smaller is Better)78.18134
HQIC (Smaller is Better)72.98226


Output 56.2.5 displays the results that correspond to those in Output 56.2.2 in the MIXED procedure.

Output 56.2.5: Parameter Estimates and Solutions: HPMIXED Procedure

Covariance Parameter Estimates
Cov ParmEstimate
Family2.4010
Family*Gender1.7657
Residual2.1668

Solution for Fixed Effects
EffectGenderEstimateStandard
Error
DFt ValuePr > |t|
Intercept 0....
GenderF64.84931.14771656.50<.0001
GenderM68.21141.14771659.43<.0001

Solution for Random Effects
EffectGenderFamilyEstimateStd Err PredDFt ValuePr > |t|
Family 11.26801.1201161.130.2743
Family 20.089801.1121160.080.9366
Family 3-1.66601.171216-1.420.1741
Family 40.30821.1201160.280.7867
Family*GenderF1-0.31981.081016-0.300.7712
Family*GenderM11.25231.0933161.150.2689
Family*GenderF2-0.42991.077416-0.400.6951
Family*GenderM20.49591.0774160.460.6515
Family*GenderF3-0.082291.140916-0.070.9434
Family*GenderM3-1.14291.140916-1.000.3314
Family*GenderF40.83201.0933160.760.4577
Family*GenderM4-0.60531.081016-0.560.5832


A number of points are noteworthy in comparing the results from the procedures. The covariance parameter estimates are the same, yet the solutions for the fixed effects differ. In fact, both solutions are correct. Solving a sparse system of linear equations requires reordering of the mixed model equations to minimize memory consumption in the factorization process. As a consequence, the order in which singularities are detected can differ from the order in which effects enter the model. Mathematically, the two sets of solutions simply correspond to different choices for the generalized inverse in solving a singular linear system. See the sections Generalized Inverse Matrices and Linear Model Theory, in Chapter 3: Introduction to Statistical Modeling with SAS/STAT Software, for more information about the role and importance of generalized inverses in linear model analysis.

Although the two sets of solutions for the fixed effects correspond to different choices of generalized inverses, many important results are invariant to the choice of the g-inverse. For example, the solutions for the random effects in Output 56.2.5 and Output 56.2.2 are identical. Also, the test for the Gender effect yields the same F value in both analyses (compare Output 56.2.6 and Output 56.2.3). However, note that the p-values associated with both F tests and t tests differ between the two procedures. This is due to their different default methods for computing the degrees of freedom. For this model, the HPMIXED procedure use the residual method to determine the denominator degrees of freedom for tests of fixed effects, whereas the MIXED procedure uses the containment method. The containment method is order-dependent, and thus not available in the HPMIXED procedure.

Output 56.2.6: Parameter Estimates and Solutions: HPMIXED Procedure

Type III Tests of Fixed Effects
EffectNum DFDen DFF ValuePr > F
Gender1167.950.0123