Two-Way Random-Effect Model

Newswriting Efficiency Example

Program Listing

OPTIONS LS=76 NODATE NONUMBER NOCENTER;

DATA assess (DROP=rep);
 DO wp = 1 TO 3;   /* 3 word-processors */
  DO writer = 1 TO 4;   /* 4 writers */
   DO rep = 1 TO 3;   /* 3 replicates */
    INPUT eff @@;
    OUTPUT;
   END;
  END;
 END;
 DATALINES;
116 113 115   129 124 123   119 124 126   123 123 129
120 120 123   124 115 117   119 122 117   114 120 122
117 115 118   123 127 123   130 134 128   117 121 118
;

TITLE1 'Two-Way Random Effects Model';
TITLE2 'Newswriting Efficiency Example';
TITLE3 'Using Proc GLM';
PROC GLM DATA=assess;
 CLASS wp writer;
 TITLE4 "ANOVA and 'Correct' Tests";
 MODEL eff = wp|writer;
 RANDOM wp|writer / TEST;
RUN;
 TITLE4 'Hypothesis Tests';
 TEST H = wp writer    E = wp*writer;
RUN;
QUIT;

TITLE3 'Using Proc Varcomp';
PROC VARCOMP DATA=assess;
 CLASS wp writer;
 MODEL eff = wp|writer;
RUN;

TITLE3 'Using Proc Mixed';
PROC MIXED DATA=assess;
 CLASS wp writer;
 MODEL eff =;
 RANDOM wp|writer / CL ALPHA=0.05;
 ESTIMATE 'WordProcesser 3*Writer 3 Interaction'
          INTERCEPT 0 | wp*writer
          0 0 0 0   0 0 0 0   0 0 1 
          / DF=24 UPPER CL ALPHA=0.01;
RUN;

Output Listing

Two-Way Random Effects Model
Newswriting Efficiency Example
Using Proc GLM
ANOVA and 'Correct' Tests

The GLM Procedure

    Class Level Information
Class         Levels    Values
wp                 3    1 2 3
writer             4    1 2 3 4


Number of Observations Read          36
Number of Observations Used          36



Two-Way Random Effects Model
Newswriting Efficiency Example
Using Proc GLM
ANOVA and 'Correct' Tests

The GLM Procedure

Dependent Variable: eff
                              Sum of
Source              DF       Squares   Mean Square  F Value  Pr > F
Model               11   660.0000000    60.0000000     6.67  <.0001
Error               24   216.0000000     9.0000000
Corrected Total     35   876.0000000


R-Square     Coeff Var      Root MSE      eff Mean
0.753425      2.472527      3.000000      121.3333


Source          DF     Type I SS   Mean Square  F Value  Pr > F
wp               2    68.1666667    34.0833333     3.79  0.0372
writer           3   238.6666667    79.5555556     8.84  0.0004
wp*writer        6   353.1666667    58.8611111     6.54  0.0003


Source          DF   Type III SS   Mean Square  F Value  Pr > F
wp               2    68.1666667    34.0833333     3.79  0.0372
writer           3   238.6666667    79.5555556     8.84  0.0004
wp*writer        6   353.1666667    58.8611111     6.54  0.0003



Two-Way Random Effects Model
Newswriting Efficiency Example
Using Proc GLM
ANOVA and 'Correct' Tests

The GLM Procedure

Source          Type III Expected Mean Square
wp              Var(Error) + 3 Var(wp*writer) + 12 Var(wp)
writer          Var(Error) + 3 Var(wp*writer) + 9 Var(writer)
wp*writer       Var(Error) + 3 Var(wp*writer)



Two-Way Random Effects Model
Newswriting Efficiency Example
Using Proc GLM
ANOVA and 'Correct' Tests

The GLM Procedure
Tests of Hypotheses for Random Model Analysis of Variance

Dependent Variable: eff

Source                 DF  Type III SS  Mean Square  F Value  Pr > F
wp                      2    68.166667    34.083333     0.58  0.5889
writer                  3   238.666667    79.555556     1.35  0.3437
Error: MS(wp*writer)    6   353.166667    58.861111


Source             DF   Type III SS   Mean Square  F Value  Pr > F
wp*writer           6    353.166667     58.861111     6.54  0.0003
Error: MS(Error)   24    216.000000      9.000000



Two-Way Random Effects Model
Newswriting Efficiency Example
Using Proc GLM
Hypothesis Tests

Dependent Variable: eff

Tests of Hypotheses Using the Type III MS for wp*writer as an Error Term

Source          DF   Type III SS   Mean Square  F Value  Pr > F
wp               2    68.1666667    34.0833333     0.58  0.5889
writer           3   238.6666667    79.5555556     1.35  0.3437



Two-Way Random Effects Model
Newswriting Efficiency Example
Using Proc Varcomp

Variance Components Estimation Procedure

    Class Level Information

Class         Levels    Values
wp                 3    1 2 3
writer             4    1 2 3 4

Number of Observations Read          36
Number of Observations Used          36


            MIVQUE(0) SSQ Matrix

Source             wp      writer   wp*writer
wp          288.00000           0    72.00000
writer              0   243.00000    81.00000
wp*writer    72.00000    81.00000    99.00000
Error        24.00000    27.00000    33.00000

      MIVQUE(0) SSQ Matrix

Source          Error         eff
wp           24.00000   818.00000
writer       27.00000      2148.0
wp*writer    33.00000      1980.0
Error        35.00000   876.00000


      MIVQUE(0) Estimates

Variance Component           eff

Var(wp)                 -2.06481
Var(writer)              2.29938
Var(wp*writer)          16.62037
Var(Error)               9.00000



Two-Way Random Effects Model
Newswriting Efficiency Example
Using Proc Mixed

The Mixed Procedure

                  Model Information

Data Set                     WORK.ASSESS
Dependent Variable           eff
Covariance Structure         Variance Components
Estimation Method            REML
Residual Variance Method     Profile
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Containment


             Class Level Information

Class     Levels    Values
wp             3    1 2 3
writer         4    1 2 3 4

            Dimensions

Covariance Parameters             4
Columns in X                      1
Columns in Z                     19
Subjects                          1
Max Obs Per Subject              36


          Number of Observations

Number of Observations Read              36
Number of Observations Used              36
Number of Observations Not Used           0


                     Iteration History

Iteration    Evaluations    -2 Res Log Like       Criterion

        0              1       215.60984729
        1              3       200.48624715      0.00003430
        2              1       200.48384025      0.00000008
        3              1       200.48383484      0.00000000



Two-Way Random Effects Model
Newswriting Efficiency Example
Using Proc Mixed

The Mixed Procedure

                   Convergence criteria met.


 Covariance Parameter
      Estimates

Cov Parm      Estimate
wp                   0
writer          2.9877
wp*writer      14.5555
Residual        9.0000


           Fit Statistics

-2 Res Log Likelihood           200.5
AIC (smaller is better)         206.5
AICC (smaller is better)        207.3
BIC (smaller is better)         203.8


                       Solution for Random Effects

                               Std Err
Effect   wp  writer  Estimate     Pred   DF  t Value  Pr > |t|  Alpha
wp       1                  0        .    .      .       .          .
wp       2                  0        .    .      .       .          .
wp       3                  0        .    .      .       .          .
writer       1        -1.3144   1.4934   24    -0.88    0.3875   0.05
writer       2         0.4882   1.4934   24     0.33    0.7466   0.05
writer       3         1.0140   1.4934   24     0.68    0.5037   0.05


        Solution for Random Effects

Effect     wp  writer     Lower       Upper
wp         1                  .           .
wp         2                  .           .
wp         3                  .           .
writer         1        -4.3967      1.7679
writer         2        -2.5941      3.5705
writer         3        -2.0683      4.0962



Two-Way Random Effects Model
Newswriting Efficiency Example
Using Proc Mixed

The Mixed Procedure

                       Solution for Random Effects

                                Std Err
Effect     wp  writer  Estimate    Pred  DF  t Value  Pr > |t|  Alpha
writer         4        -0.1878  1.4934  24    -0.13    0.9010   0.05
wp*writer  1   1        -4.4376  2.1243  24    -2.09    0.0475   0.05
wp*writer  1   2         2.9117  2.1243  24     1.37    0.1832   0.05
wp*writer  1   3         0.5412  2.1243  24     0.25    0.8011   0.05
wp*writer  1   4         3.1958  2.1243  24     1.50    0.1455   0.05
wp*writer  2   1         0.8134  2.1243  24     0.38    0.7052   0.05
wp*writer  2   2        -2.6157  2.1243  24    -1.23    0.2301   0.05
wp*writer  2   3        -2.4989  2.1243  24    -1.18    0.2510   0.05
wp*writer  2   4        -2.0553  2.1243  24    -0.97    0.3429   0.05
wp*writer  3   1        -2.7794  2.1243  24    -1.31    0.2031   0.05
wp*writer  3   2         2.0826  2.1243  24     0.98    0.3367   0.05
wp*writer  3   3         6.8977  2.1243  24     3.25    0.0034   0.05
wp*writer  3   4        -2.0553  2.1243  24    -0.97    0.3429   0.05


        Solution for Random Effects

Effect     wp  writer     Lower       Upper

writer         4        -3.2700      2.8945
wp*writer  1   1        -8.8220    -0.05324
wp*writer  1   2        -1.4727      7.2961
wp*writer  1   3        -3.8432      4.9255
wp*writer  1   4        -1.1886      7.5802
wp*writer  2   1        -3.5710      5.1978
wp*writer  2   2        -7.0001      1.7686
wp*writer  2   3        -6.8833      1.8855
wp*writer  2   4        -6.4397      2.3291
wp*writer  3   1        -7.1638      1.6050
wp*writer  3   2        -2.3018      6.4670
wp*writer  3   3         2.5133     11.2821
wp*writer  3   4        -6.4397      2.3291


                           Estimates

                                               Standard
Label                                 Estimate    Error  DF  t Value
WordProcesser 3*Writer 3 Interaction    6.8977   2.1243  24     3.25



Two-Way Random Effects Model
Newswriting Efficiency Example
Using Proc Mixed

The Mixed Procedure

                           Estimates

Label                                  Pr > t  Alpha    Lower    Upper
WordProcesser 3*Writer 3 Interaction   0.0017   0.01   1.6035        .