[http://www.ats.ucla.edu/stat/_headers/header1.htm][http://www.ats.ucla.edu/stat/sas/examples/mld_weiss/header.htm][http://www.ats.ucla.edu/stat/_headers/header2.htm]

SAS Textbook Examples
Modeling Longitudinal Data by Robert Weiss
Chapter 8: Modeling the Covariance Matrix

Table 8.1, page 275.
data sm;
 set smallmice;
 cont_day = day;
 cont_day2 = day**2;
run;

*Model #7: ARH(1);
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2 /notest;
 repeated day / subject = id type = arh(1);
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Heterogeneous
                             Autoregressive
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           990.9
AIC (smaller is better)        1006.9
AICC (smaller is better)       1008.5
BIC (smaller is better)        1012.0

    DF    Chi-Square      Pr > ChiSq
     7        172.22          <.0001

*Model 12: ANTEH;
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2 /notest;
 repeated day / subject = id type = ante(1);
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Ante-dependence
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           983.1
AIC (smaller is better)        1009.1
AICC (smaller is better)       1013.6
BIC (smaller is better)        1017.4

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
    12        180.00          <.0001
     
*Model 13: FAH(2);
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ notest;
 repeated day / subject = id type = fah(2);
run;     

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Factor Analytic
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           977.1
AIC (smaller is better)        1015.1
AICC (smaller is better)       1025.2
BIC (smaller is better)        1027.2

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
    18        185.98          <.0001

*Model 14: UN;
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ notest;
 repeated day / subject = id type = un;
run;


The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Unstructured
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           964.7
AIC (smaller is better)        1020.7
AICC (smaller is better)       1045.3
BIC (smaller is better)        1038.6

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
    27        198.41          <.0001

*Model 2: AR(1);
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ notest;
 repeated day / subject = id type = ar(1);
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Autoregressive
Subject Effect               id
Estimation Method            REML
Residual Variance Method     Profile
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood          1035.3
AIC (smaller is better)        1039.3
AICC (smaller is better)       1039.4
BIC (smaller is better)        1040.5

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     1        127.83          <.0001

*Model 5: ARMA;
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ notest;
 repeated day / subject = id type = arma(1,1);
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Autoregressive
                             Moving Average
Subject Effect               id
Estimation Method            REML
Residual Variance Method     Profile
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood          1032.9
AIC (smaller is better)        1038.9
AICC (smaller is better)       1039.2
BIC (smaller is better)        1040.8

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     2        130.18          <.0001
     
*Model 10: FA(2);
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ notest;
 repeated day / subject = id type = fa1(2);
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Factor Analytic
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood          1004.0
AIC (smaller is better)        1032.0
AICC (smaller is better)       1037.3
BIC (smaller is better)        1041.0

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
    13        159.05          <.0001

*Model 8: FA(1);
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ notest;
 repeated day / subject = id type = fa1(1);
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Factor Analytic
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood          1020.4
AIC (smaller is better)        1036.4
AICC (smaller is better)       1038.1
BIC (smaller is better)        1041.5

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     7        142.69          <.0001

*Model 3: RS;
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ notest;
 random cont_day/ subject = id type = un;
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Unstructured
Subject Effect               id
Estimation Method            REML
Residual Variance Method     Profile
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Containment

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood          1041.0
AIC (smaller is better)        1045.0
AICC (smaller is better)       1045.1
BIC (smaller is better)        1046.3

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     2        122.10          <.0001

*Model 6: RIAS;
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ notest;
 random intercept cont_day / subject = id type = un;
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Unstructured
Subject Effect               id
Estimation Method            REML
Residual Variance Method     Profile
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Containment

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood          1038.6
AIC (smaller is better)        1046.6
AICC (smaller is better)       1047.0
BIC (smaller is better)        1049.2

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     3        124.48          <.0001

*Model 11: FAH(1);
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ notest;
 repeated day / subject = id type = fa(1);
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Factor Analytic
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood          1016.8
AIC (smaller is better)        1044.8
AICC (smaller is better)       1050.0
BIC (smaller is better)        1053.7

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
    13        146.33          <.0001

*Model 9: CSH;
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ notest;
 repeated day / subject = id type = csh;
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Heterogeneous Compound
                             Symmetry
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood          1050.7
AIC (smaller is better)        1066.7
AICC (smaller is better)       1068.3
BIC (smaller is better)        1071.8

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     7        112.43          <.0001

*Model 4: RI;
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ notest;
 repeated day / subject = id type = cs;
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Compound Symmetry
Subject Effect               id
Estimation Method            REML
Residual Variance Method     Profile
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood          1105.3
AIC (smaller is better)        1109.3
AICC (smaller is better)       1109.4
BIC (smaller is better)        1110.6

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     1         57.80          <.0001

*Model 1: IND;
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ notest;
 repeated day / subject = id type = vc;
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.SM
Dependent Variable           weight
Covariance Structure         Variance Components
Subject Effect               id
Estimation Method            REML
Residual Variance Method     Parameter
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood          1163.1
AIC (smaller is better)        1165.1
AICC (smaller is better)       1165.1
BIC (smaller is better)        1165.7

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     0          0.00          1.0000
Table 8.3, page 277.
*arh(1);
proc mixed data = sm method = reml noitprint noclprint noinfo;
 class id day;
 model weight = cont_day cont_day2/ solution notest;
 repeated day / subject = id type = arh(1) rcorr;
run;

The Mixed Procedure

                        Estimated R Correlation Matrix for id 22
 Row        Col1        Col2        Col3        Col4        Col5        Col6        Col7
   1      1.0000      0.8963      0.8034      0.7201      0.6454      0.5785      0.5185
   2      0.8963      1.0000      0.8963      0.8034      0.7201      0.6454      0.5785
   3      0.8034      0.8963      1.0000      0.8963      0.8034      0.7201      0.6454
   4      0.7201      0.8034      0.8963      1.0000      0.8963      0.8034      0.7201
   5      0.6454      0.7201      0.8034      0.8963      1.0000      0.8963      0.8034
   6      0.5785      0.6454      0.7201      0.8034      0.8963      1.0000      0.8963
   7      0.5185      0.5785      0.6454      0.7201      0.8034      0.8963      1.0000

[...output omitted...]

*ANTEH;
proc mixed data = sm method = reml noitprint noclprint noinfo;
 class id day;
 model weight = cont_day cont_day2/ solution notest ;
 repeated day / subject = id type = ante(1) rcorr;
run;

The Mixed Procedure

                        Estimated R Correlation Matrix for id 22
 Row        Col1        Col2        Col3        Col4        Col5        Col6        Col7
   1      1.0000      0.9228      0.6901      0.5995      0.5578      0.5217      0.4787
   2      0.9228      1.0000      0.7478      0.6496      0.6044      0.5653      0.5187
   3      0.6901      0.7478      1.0000      0.8687      0.8082      0.7560      0.6937
   4      0.5995      0.6496      0.8687      1.0000      0.9304      0.8703      0.7985
   5      0.5578      0.6044      0.8082      0.9304      1.0000      0.9353      0.8582
   6      0.5217      0.5653      0.7560      0.8703      0.9353      1.0000      0.9176
   7      0.4787      0.5187      0.6937      0.7985      0.8582      0.9176      1.0000

[...output omitted...]

*FAH(2);
proc mixed data = sm method = reml noclprint noinfo noitprint;
 class id day;
 model weight = cont_day cont_day2/ solution notest ;
 repeated day / subject = id type = fah(2) rcorr;
run;

The Mixed Procedure

                        Estimated R Correlation Matrix for id 22
 Row        Col1        Col2        Col3        Col4        Col5        Col6        Col7
   1      1.0000      0.9276      0.5844      0.3110      0.2056      0.2189      0.3083
   2      0.9276      1.0000      0.7424      0.4978      0.3998      0.4090      0.4886
   3      0.5844      0.7424      1.0000      0.8311      0.8024      0.7946      0.8064
   4      0.3110      0.4978      0.8311      1.0000      0.9304      0.9138      0.8849
   5      0.2056      0.3998      0.8024      0.9304      1.0000      0.9416      0.8984
   6      0.2189      0.4090      0.7946      0.9138      0.9416      1.0000      0.8825
   7      0.3083      0.4886      0.8064      0.8849      0.8984      0.8825      1.0000

*UN;
proc mixed data = sm method = reml noitprint noclprint noinfo;
 class id day;
 model weight = cont_day cont_day2/ solution notest ;
 repeated day / subject = id type = un rcorr;
run;

The Mixed Procedure

                        Estimated R Correlation Matrix for id 22
 Row        Col1        Col2        Col3        Col4        Col5        Col6        Col7
   1      1.0000      0.9188      0.4962      0.3033      0.1785      0.2329      0.3489
   2      0.9188      1.0000      0.7317      0.5060      0.4205      0.4178      0.5308
   3      0.4962      0.7317      1.0000      0.8737      0.8136      0.7500      0.8105
   4      0.3033      0.5060      0.8737      1.0000      0.9330      0.9010      0.8665
   5      0.1785      0.4205      0.8136      0.9330      1.0000      0.9372      0.8871
   6      0.2329      0.4178      0.7500      0.9010      0.9372      1.0000      0.9191
   7      0.3489      0.5308      0.8105      0.8665      0.8871      0.9191      1.0000
Table 8.4, page 278.
*ARH(1);
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ solution notest;
 repeated day / subject = id type = arh(1);
run;

[...output omitted...]

                   Solution for Fixed Effects
                         Standard
Effect       Estimate       Error      DF    t Value    Pr > |t|
Intercept     78.8108      6.9230      13      11.38      <.0001
cont_day      67.1741      3.0942      82      21.71      <.0001
cont_day2     -1.1793      0.1421      82      -8.30      <.0001

*ANTE;
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ solution notest ;
 repeated day / subject = id type = ante(1);
run;

[...output omitted...]

                   Solution for Fixed Effects
                         Standard
Effect       Estimate       Error      DF    t Value    Pr > |t|
Intercept     81.3278      6.1346      13      13.26      <.0001
cont_day      66.3829      2.3550      82      28.19      <.0001
cont_day2     -1.1773      0.1152      82     -10.22      <.0001

*FAH(2);
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ solution notest ;
 repeated day / subject = id type = fah(2);
run;

[...output omitted...]

                   Solution for Fixed Effects
                         Standard
Effect       Estimate       Error      DF    t Value    Pr > |t|
Intercept     84.7254      5.6912      13      14.89      <.0001
cont_day      67.1351      2.2533      82      29.79      <.0001
cont_day2     -1.2583     0.08510      82     -14.79      <.0001

*UN;
proc mixed data = sm method = reml noclprint noitprint;
 class id day;
 model weight = cont_day cont_day2/ solution notest ;
 repeated day / subject = id type = un;
run;

[...output omitted...]

                         Standard
Effect       Estimate       Error      DF    t Value    Pr > |t|
Intercept     89.5909      4.5755      13      19.58      <.0001
cont_day      64.1899      2.3275      13      27.58      <.0001
cont_day2     -1.1105     0.09463      13     -11.74      <.0001
Table 8.5, page 279.
data pain1;
 set pain;
  tmt = "Z";
  if trial = 4 and treatment = "attend" then tmt = "A";
  if trial = 4 and treatment = "distract" then tmt = "D";
  if trial = 4 and treatment = "no directions" then tmt = "N";
  cont_trial = trial;
  logpain = log(paintol);
run;

*RI;
proc mixed data = pain1 method = reml noclprint noitprint;
 class id trial tmt cs;
 model logpain = cs|tmt/ notest;
 random intercept / subject = id type = un;
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.PAIN1
Dependent Variable           logpain
Covariance Structure         Unstructured
Subject Effect               id
Estimation Method            REML
Residual Variance Method     Profile
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Containment

            Dimensions
Covariance Parameters             2
Columns in X                     15
Columns in Z Per Subject          1
Subjects                         64
Max Obs Per Subject               4

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           408.2
AIC (smaller is better)         412.2
AICC (smaller is better)        412.3
BIC (smaller is better)         416.5

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     1        142.92          <.0001
     
*ARMA(1,1);
proc mixed data = pain1 method = reml noclprint noitprint;
 class id trial tmt cs;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = arma(1,1);
run;     

The Mixed Procedure

                  Model Information
Data Set                     WORK.PAIN1
Dependent Variable           logpain
Covariance Structure         Autoregressive
                             Moving Average
Subject Effect               id
Estimation Method            REML
Residual Variance Method     Profile
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

            Dimensions
Covariance Parameters             3
Columns in X                     15
Columns in Z                      0
Subjects                         64
Max Obs Per Subject               4

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           406.1
AIC (smaller is better)         412.1
AICC (smaller is better)        412.2
BIC (smaller is better)         418.6

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     2        145.01          <.0001

*RIAS;
proc mixed data = pain1 method = reml noclprint noitprint;
 class id tmt cs;
 model logpain = cs|tmt trial/ notest;
 random intercept trial / subject = id type = un;
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.PAIN1
Dependent Variable           logpain
Covariance Structure         Unstructured
Subject Effect               id
Estimation Method            REML
Residual Variance Method     Profile
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Containment

            Dimensions
Covariance Parameters             4
Columns in X                     16
Columns in Z Per Subject          2
Subjects                         64
Max Obs Per Subject               4

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           408.0
AIC (smaller is better)         416.0
AICC (smaller is better)        416.1
  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     2        146.10          <.0001

*FA(1);
proc mixed data = pain1 method = reml noclprint noitprint;
 class id trial tmt cs;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = fa1(1);
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.PAIN1
Dependent Variable           logpain
Covariance Structure         Factor Analytic
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

            Dimensions
Covariance Parameters             5
Columns in X                     15
Columns in Z                      0
Subjects                         64
Max Obs Per Subject               4

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           403.9
AIC (smaller is better)         413.9
AICC (smaller is better)        414.2
BIC (smaller is better)         424.7

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     4        147.23          <.0001

*UN;
proc mixed data = pain1 method = reml noclprint noitprint;
 class id trial tmt cs;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = un;
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.PAIN1
Dependent Variable           logpain
Covariance Structure         Unstructured
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

            Dimensions
Covariance Parameters            10
Columns in X                     15
Columns in Z                      0
Subjects                         64
Max Obs Per Subject               4

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           385.1
AIC (smaller is better)         405.1
AICC (smaller is better)        406.1
BIC (smaller is better)         426.7

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     9        166.04          <.0001

*FA(2);
proc mixed data = pain1 method = reml noclprint noitprint;
 class id trial tmt cs;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = fa1(2);
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.PAIN1
Dependent Variable           logpain
Covariance Structure         Factor Analytic
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

            Dimensions
Covariance Parameters             8
Columns in X                     15
Columns in Z                      0
Subjects                         64
Max Obs Per Subject               4

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           396.7
AIC (smaller is better)         412.7
AICC (smaller is better)        413.3
BIC (smaller is better)         429.9

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     7        154.46          <.0001

*FAH(1);
proc mixed data = pain1 method = reml noclprint noitprint;
 class id trial tmt cs;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = fa(1);
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.PAIN1
Dependent Variable           logpain
Covariance Structure         Factor Analytic
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

            Dimensions
Covariance Parameters             8
Columns in X                     15
Columns in Z                      0
Subjects                         64
Max Obs Per Subject               4

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           396.8
AIC (smaller is better)         412.8
AICC (smaller is better)        413.4
BIC (smaller is better)         430.0

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     7        154.39          <.0001

*AR(1);
proc mixed data = pain1 method = reml noclprint noitprint;
 class id trial tmt cs;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = ar(1);
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.PAIN1
Dependent Variable           logpain
Covariance Structure         Autoregressive
Subject Effect               id
Estimation Method            REML
Residual Variance Method     Profile
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

            Dimensions
Covariance Parameters             2
Columns in X                     15
Columns in Z                      0
Subjects                         64
Max Obs Per Subject               4

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           428.9
AIC (smaller is better)         432.9
AICC (smaller is better)        432.9
BIC (smaller is better)         437.2

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     1        122.29          <.0001

*ANTEH(1);
proc mixed data = pain1 method = reml noclprint noitprint;
 class id trial tmt cs;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = ante(1);
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.PAIN1
Dependent Variable           logpain
Covariance Structure         Ante-dependence
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

            Dimensions
Covariance Parameters             7
Columns in X                     15
Columns in Z                      0
Subjects                         64
Max Obs Per Subject               4

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           426.3
AIC (smaller is better)         440.3
AICC (smaller is better)        440.8
BIC (smaller is better)         455.4

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     6        124.82          <.0001

*IND;
proc mixed data = pain1 method = reml noclprint noitprint;
 class id trial tmt cs;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = vc;
run;

The Mixed Procedure

                  Model Information
Data Set                     WORK.PAIN1
Dependent Variable           logpain
Covariance Structure         Variance Components
Subject Effect               id
Estimation Method            REML
Residual Variance Method     Parameter
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

            Dimensions
Covariance Parameters             1
Columns in X                     15
Columns in Z                      0
Subjects                         64
Max Obs Per Subject               4

[...output omitted...]

           Fit Statistics
-2 Res Log Likelihood           551.1
AIC (smaller is better)         553.1
AICC (smaller is better)        553.2
BIC (smaller is better)         555.3

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     0          0.00          1.0000
Table 8.6, page 280.
proc mixed data = pain1 method = reml noclprint noitprint;
 class id trial tmt cs;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = un rcorr;
run;

The Mixed Procedure

                  Model Information

Data Set                     WORK.PAIN1
Dependent Variable           logpain
Covariance Structure         Unstructured
Subject Effect               id
Estimation Method            REML
Residual Variance Method     None
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Between-Within

            Dimensions
Covariance Parameters            10
Columns in X                     15
Columns in Z                      0
Subjects                         64
Max Obs Per Subject               4

          Number of Observations
Number of Observations Read             256
Number of Observations Used             245
Number of Observations Not Used          11

       Estimated R Correlation Matrix for id 1
 Row        Col1        Col2        Col3        Col4
   1      1.0000      0.7015      0.8196      0.5489
   2      0.7015      1.0000      0.7072      0.6727
   3      0.8196      0.7072      1.0000      0.7326
   4      0.5489      0.6727      0.7326      1.0000

Covariance Parameter Estimates
Cov Parm    Subject    Estimate
UN(1,1)     id           0.4847
UN(2,1)     id           0.3593
UN(2,2)     id           0.5411
UN(3,1)     id           0.4564
UN(3,2)     id           0.4161
UN(3,3)     id           0.6398
UN(4,1)     id           0.2764
UN(4,2)     id           0.3578
UN(4,3)     id           0.4238
UN(4,4)     id           0.5230

           Fit Statistics
-2 Res Log Likelihood           385.1
AIC (smaller is better)         405.1
AICC (smaller is better)        406.1
BIC (smaller is better)         426.7

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     9        166.04          <.0001
Table 8.7, page 281.
data pain2;
 set pain;
 tmt_a = (treatment = "attend")*(trial = 4);
 tmt_d = (treatment = "distract")*(trial = 4);
 tmt_n = (treatment = "no directions")*(trial = 4);
 attend = (cs = "attender");
 distract = (cs = "distracter");
 logpain = log(paintol);
run;

*TOP MODEL;
proc mixed data = pain2 method = reml noclprint noitprint;
 class id trial ;
 model logpain = attend tmt_a tmt_d tmt_n attend*tmt_a 
	attend*tmt_d attend*tmt_n/ notest solution;
 repeated trial / subject = id type = un;
 estimate 'DA' tmt_a 1 ;
 estimate 'DD' tmt_d 1 ;
 estimate 'DN' tmt_n 1 ;
 estimate 'AA' attend*tmt_a 1 tmt_a 1 ;
 estimate 'AD' attend*tmt_d 1 tmt_d 1 ;
 estimate 'AN' attend*tmt_n 1 tmt_n 1 ;
run;

The Mixed Procedure

[...output omitted...]

                    Solution for Fixed Effects
                            Standard
Effect          Estimate       Error      DF    t Value    Pr > |t|
Intercept         3.5109      0.1167      62      30.08      <.0001
attend           -0.3560      0.1650      62      -2.16      0.0348
tmt_a            -0.1352      0.1467      62      -0.92      0.3603
tmt_d             0.4900      0.1403      62       3.49      0.0009
tmt_n            -0.3495      0.1509      62      -2.32      0.0238
attend*tmt_a      0.2317      0.2075      62       1.12      0.2684
attend*tmt_d     -0.4245      0.2030      62      -2.09      0.0406
attend*tmt_n      0.3313      0.2118      62       1.56      0.1228

                         Estimates
                     Standard
Label    Estimate       Error      DF    t Value    Pr > |t|
DA        -0.1352      0.1467      62      -0.92      0.3603
DD         0.4900      0.1403      62       3.49      0.0009
DN        -0.3495      0.1509      62      -2.32      0.0238
AA        0.09650      0.1467      62       0.66      0.5131
AD        0.06547      0.1467      62       0.45      0.6569
AN       -0.01820      0.1486      62      -0.12      0.9029

*Bottom MODEL;
proc mixed data = pain2 method = reml noclprint noitprint;
 class id trial ;
 model logpain = attend tmt_a tmt_d tmt_n attend*tmt_a attend*tmt_d attend*tmt_n/ notest solution;
 random intercept / subject = id type = cs;
 estimate 'DA' tmt_a 1 ;
 estimate 'DD' tmt_d 1 ;
 estimate 'DN' tmt_n 1 ;
 estimate 'AA' attend*tmt_a 1 tmt_a 1 ;
 estimate 'AD' attend*tmt_d 1 tmt_d 1 ;
 estimate 'AN' attend*tmt_n 1 tmt_n 1 ;
run;

The Mixed Procedure

[...output omitted...]

                    Solution for Fixed Effects
                            Standard
Effect          Estimate       Error      DF    t Value    Pr > |t|
Intercept         3.4731      0.1173      62      29.62      <.0001
attend           -0.3313      0.1659     175      -2.00      0.0474
tmt_a            -0.2438      0.1467     175      -1.66      0.0982
tmt_d             0.3993      0.1399     175       2.85      0.0048
tmt_n            -0.3340      0.1493     175      -2.24      0.0266
attend*tmt_a      0.3188      0.2074     175       1.54      0.1261
attend*tmt_d     -0.3723      0.2027     175      -1.84      0.0680
attend*tmt_n      0.2590      0.2098     175       1.23      0.2187

                         Estimates
                     Standard
Label    Estimate       Error      DF    t Value    Pr > |t|
DA        -0.2438      0.1467     175      -1.66      0.0982
DD         0.3993      0.1399     175       2.85      0.0048
DN        -0.3340      0.1493     175      -2.24      0.0266
AA        0.07499      0.1467     175       0.51      0.6098
AD        0.02700      0.1467     175       0.18      0.8542
AN       -0.07500      0.1474     175      -0.51      0.6114
Table 8.8, page 283.
*RI-2;
proc mixed data = pain1 method = reml noclprint noitprint noinfo;
 class cs treatment id trial tmt;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = cs group = cs;
run;

The Mixed Procedure

         Covariance Parameter Estimates
Cov Parm     Subject    Group            Estimate
Variance     id         cs attender       0.09966
CS           id         cs attender        0.3004
Variance     id         cs distracter      0.2294
CS           id         cs distracter      0.4630

           Fit Statistics
-2 Res Log Likelihood           391.7
AIC (smaller is better)         399.7
AICC (smaller is better)        399.9
BIC (smaller is better)         408.4

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     3        159.40          <.0001

*UN-2;
proc mixed data = pain1 method = reml noclprint noitprint noinfo;
 class cs tmt id trial;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = un group = cs;
run;

The Mixed Procedure

         Covariance Parameter Estimates
Cov Parm    Subject    Group            Estimate
UN(1,1)     id         cs attender        0.3800
UN(2,1)     id         cs attender        0.3599
UN(2,2)     id         cs attender        0.4801
UN(3,1)     id         cs attender        0.3360
UN(3,2)     id         cs attender        0.3390
UN(3,3)     id         cs attender        0.3980
UN(4,1)     id         cs attender        0.2244
UN(4,2)     id         cs attender        0.2959
UN(4,3)     id         cs attender        0.2655
UN(4,4)     id         cs attender        0.3582
UN(1,1)     id         cs distracter      0.5874
UN(2,1)     id         cs distracter      0.3621
UN(2,2)     id         cs distracter      0.6100
UN(3,1)     id         cs distracter      0.5769
UN(3,2)     id         cs distracter      0.4978
UN(3,3)     id         cs distracter      0.8828
UN(4,1)     id         cs distracter      0.3323
UN(4,2)     id         cs distracter      0.4283
UN(4,3)     id         cs distracter      0.5878
UN(4,4)     id         cs distracter      0.6941

           Fit Statistics
-2 Res Log Likelihood           361.2
AIC (smaller is better)         401.2
AICC (smaller is better)        405.1
BIC (smaller is better)         444.4

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
    19        189.96          <.0001

*RI;
proc mixed data = pain1 method = reml noclprint noitprint noinfo;
 class cs treatment id trial tmt;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = cs;
run;

The Mixed Procedure

 Covariance Parameter Estimates
Cov Parm     Subject    Estimate
CS           id           0.3814
Residual                  0.1649

           Fit Statistics
-2 Res Log Likelihood           408.2
AIC (smaller is better)         412.2
AICC (smaller is better)        412.3
BIC (smaller is better)         416.5

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     1        142.92          <.0001

*UN;
proc mixed data = pain1 method = reml noclprint noitprint noinfo;
 class cs tmt id trial;
 model logpain = cs|tmt/ notest;
 repeated trial / subject = id type = un;
run;

The Mixed Procedure

Covariance Parameter Estimates
Cov Parm    Subject    Estimate
UN(1,1)     id           0.4847
UN(2,1)     id           0.3593
UN(2,2)     id           0.5411
UN(3,1)     id           0.4564
UN(3,2)     id           0.4161
UN(3,3)     id           0.6398
UN(4,1)     id           0.2764
UN(4,2)     id           0.3578
UN(4,3)     id           0.4238
UN(4,4)     id           0.5230

           Fit Statistics
-2 Res Log Likelihood           385.1
AIC (smaller is better)         405.1
AICC (smaller is better)        406.1
BIC (smaller is better)         426.7

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq

*RI attenders;
proc mixed data = pain1 method = reml noclprint noitprint noinfo;
 where cs = "attender";
 class tmt id trial;
 model logpain = tmt/ notest;
 repeated trial / subject = id type = cs;
run;

The Mixed Procedure

 Covariance Parameter Estimates
Cov Parm     Subject    Estimate
CS           id           0.3003
Residual                 0.09967

           Fit Statistics
-2 Res Log Likelihood           151.3
AIC (smaller is better)         155.3
AICC (smaller is better)        155.4
BIC (smaller is better)         158.2

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     1         85.47          <.0001

*UN attenders;
proc mixed data = pain1 method = reml noclprint noitprint noinfo;
 where cs = "attender";
 class tmt id trial;
 model logpain = tmt/ notest;
 repeated trial / subject = id type = un;
run;

The Mixed Procedure

Covariance Parameter Estimates
Cov Parm    Subject    Estimate
UN(1,1)     id           0.3800
UN(2,1)     id           0.3599
UN(2,2)     id           0.4801
UN(3,1)     id           0.3360
UN(3,2)     id           0.3390
UN(3,3)     id           0.3980
UN(4,1)     id           0.2244
UN(4,2)     id           0.2959
UN(4,3)     id           0.2655
UN(4,4)     id           0.3582

           Fit Statistics
-2 Res Log Likelihood           134.8
AIC (smaller is better)         154.8
AICC (smaller is better)        156.9
BIC (smaller is better)         169.5

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     9        101.94          <.0001
     
*RI distracter;
proc mixed data = pain1 method = reml noclprint noitprint noinfo;
 where cs = "distracter";
 class tmt id trial;
 model logpain = tmt/ notest;
 repeated trial / subject = id type = cs;
run;     

The Mixed Procedure

 Covariance Parameter Estimates
Cov Parm     Subject    Estimate
CS           id           0.4630
Residual                  0.2294

           Fit Statistics
-2 Res Log Likelihood           240.5
AIC (smaller is better)         244.5
AICC (smaller is better)        244.6
BIC (smaller is better)         247.4

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     1         64.80          <.0001

*UN distracter;
proc mixed data = pain1 method = reml noclprint noitprint noinfo;
 where cs = "distracter";
 class tmt id trial;
 model logpain = tmt/ notest;
 repeated trial / subject = id type = un;
run;

The Mixed Procedure

Covariance Parameter Estimates
Cov Parm    Subject    Estimate
UN(1,1)     id           0.5874
UN(2,1)     id           0.3621
UN(2,2)     id           0.6100
UN(3,1)     id           0.5769
UN(3,2)     id           0.4978
UN(3,3)     id           0.8828
UN(4,1)     id           0.3323
UN(4,2)     id           0.4283
UN(4,3)     id           0.5878
UN(4,4)     id           0.6941

           Fit Statistics
-2 Res Log Likelihood           226.4
AIC (smaller is better)         246.4
AICC (smaller is better)        248.4
BIC (smaller is better)         261.0

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     9         78.89          <.0001
Table 8.9, page 284.
proc mixed data = pain1 method = reml covtest noclprint noitprint noinfo;
 class cs id trial tmt;
 model logpain = cs tmt/ notest;
 repeated trial / subject = id type = cs group = cs;
run;

The Mixed Procedure

                          Covariance Parameter Estimates
                                                     Standard         Z
Cov Parm     Subject    Group            Estimate       Error     Value        Pr Z
Variance     id         cs attender        0.1009     0.01540      6.55      <.0001
CS           id         cs attender        0.3034     0.08458      3.59      0.0003
Variance     id         cs distracter      0.2338     0.03513      6.66      <.0001
CS           id         cs distracter      0.4846      0.1389      3.49      0.0005

           Fit Statistics
-2 Res Log Likelihood           395.2
AIC (smaller is better)         403.2
AICC (smaller is better)        403.4
BIC (smaller is better)         411.8

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     3        163.06          <.0001
Table 8.10, page 284.
proc mixed data = pain1 method = reml covtest noclprint noitprint noinfo;
 class cs id trial tmt;
 model logpain = cs tmt/ notest;
 repeated trial / subject = id type = un group = cs;
run;

The Mixed Procedure

                          Covariance Parameter Estimates
                                                    Standard         Z
Cov Parm    Subject    Group            Estimate       Error     Value        Pr Z
UN(1,1)     id         cs attender        0.3786     0.09606      3.94      <.0001
UN(2,1)     id         cs attender        0.3600      0.1010      3.57      0.0004
UN(2,2)     id         cs attender        0.4818      0.1260      3.82      <.0001
UN(3,1)     id         cs attender        0.3354     0.09244      3.63      0.0003
UN(3,2)     id         cs attender        0.3398      0.1022      3.32      0.0009
UN(3,3)     id         cs attender        0.3981      0.1029      3.87      <.0001
UN(4,1)     id         cs attender        0.2320     0.08128      2.85      0.0043
UN(4,2)     id         cs attender        0.3032     0.09910      3.06      0.0022
UN(4,3)     id         cs attender        0.2753     0.08880      3.10      0.0019
UN(4,4)     id         cs attender        0.3778      0.1043      3.62      0.0001
UN(1,1)     id         cs distracter      0.5882      0.1505      3.91      <.0001
UN(2,1)     id         cs distracter      0.3622      0.1260      2.88      0.0040
UN(2,2)     id         cs distracter      0.6082      0.1542      3.94      <.0001
UN(3,1)     id         cs distracter      0.5780      0.1673      3.46      0.0006
UN(3,2)     id         cs distracter      0.5002      0.1608      3.11      0.0019
UN(3,3)     id         cs distracter      0.8874      0.2290      3.88      <.0001
UN(4,1)     id         cs distracter      0.3808      0.1437      2.65      0.0080
UN(4,2)     id         cs distracter      0.4552      0.1513      3.01      0.0026
UN(4,3)     id         cs distracter      0.6564      0.1965      3.34      0.0008
UN(4,4)     id         cs distracter      0.8053      0.2135      3.77      <.0001

           Fit Statistics
-2 Res Log Likelihood           364.8
AIC (smaller is better)         404.8
AICC (smaller is better)        408.6
BIC (smaller is better)         448.0

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
    19        193.44          <.0001
Table 8.11, page 285.
*Attenders;
proc mixed data = pain2 method = reml covtest noclprint noitprint noinfo;
 where cs = "attender";
 class cs id trial ;
 model logpain = cs tmt_a tmt_d tmt_n/ notest ;
 repeated trial / subject = id type = un rcorr;
run;

The Mixed Procedure

       Estimated R Correlation Matrix for id 1
 Row        Col1        Col2        Col3        Col4
   1      1.0000      0.8425      0.8641      0.6083
   2      0.8425      1.0000      0.7757      0.7136
   3      0.8641      0.7757      1.0000      0.7033
   4      0.6083      0.7136      0.7033      1.0000

                 Covariance Parameter Estimates
                                   Standard         Z
Cov Parm    Subject    Estimate       Error     Value        Pr Z
UN(1,1)     id           0.3800     0.09678      3.93      <.0001
UN(2,1)     id           0.3599      0.1009      3.57      0.0004
UN(2,2)     id           0.4801      0.1254      3.83      <.0001
UN(3,1)     id           0.3360     0.09276      3.62      0.0003
UN(3,2)     id           0.3390      0.1019      3.33      0.0009
UN(3,3)     id           0.3980      0.1029      3.87      <.0001
UN(4,1)     id           0.2244     0.07922      2.83      0.0046
UN(4,2)     id           0.2959     0.09668      3.06      0.0022
UN(4,3)     id           0.2655     0.08637      3.07      0.0021
UN(4,4)     id           0.3582     0.09872      3.63      0.0001

           Fit Statistics
-2 Res Log Likelihood           134.8
AIC (smaller is better)         154.8
AICC (smaller is better)        156.9
BIC (smaller is better)         169.5

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     9        101.94          <.0001
     
*Distracters;
proc mixed data = pain2 method = reml noinfo covtest noclprint noitprint;
 where cs = "distracter";
 class cs id trial ;
 model logpain = cs tmt_a tmt_d tmt_n/ notest;
 repeated trial / subject = id type = un rcorr;
run;

The Mixed Procedure

       Estimated R Correlation Matrix for id 2
 Row        Col1        Col2        Col3        Col4
   1      1.0000      0.6050      0.8011      0.5204
   2      0.6050      1.0000      0.6784      0.6583
   3      0.8011      0.6784      1.0000      0.7509
   4      0.5204      0.6583      0.7509      1.0000

                 Covariance Parameter Estimates
                                   Standard         Z
Cov Parm    Subject    Estimate       Error     Value        Pr Z
UN(1,1)     id           0.5874      0.1503      3.91      <.0001
UN(2,1)     id           0.3621      0.1263      2.87      0.0041
UN(2,2)     id           0.6100      0.1550      3.93      <.0001
UN(3,1)     id           0.5769      0.1669      3.46      0.0005
UN(3,2)     id           0.4978      0.1609      3.09      0.0020
UN(3,3)     id           0.8828      0.2277      3.88      <.0001
UN(4,1)     id           0.3323      0.1330      2.50      0.0125
UN(4,2)     id           0.4283      0.1412      3.03      0.0024
UN(4,3)     id           0.5878      0.1809      3.25      0.0012
UN(4,4)     id           0.6941      0.1822      3.81      <.0001

           Fit Statistics
-2 Res Log Likelihood           226.4
AIC (smaller is better)         246.4
AICC (smaller is better)        248.4
BIC (smaller is better)         261.0

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     9         78.89          <.0001
Table 8.12, page 286.

NOTE: SAS does not allow for random statement with groups in proc mixed, which is what would best fit the description of the bottom model in the book.  However, the results were matched using a repeated statement in place of a random statement.

*TOP MODEL;
proc mixed data = pain2 method = reml noclprint noitprint noinfo;
 class id trial cs;
 model logpain = attend tmt_a tmt_d tmt_n attend*tmt_a attend*tmt_d attend*tmt_n/ notest solution;
 repeated trial / subject = id type = un group=cs;
 estimate 'DA' tmt_a 1 ;
 estimate 'DD' tmt_d 1 ;
 estimate 'DN' tmt_n 1 ;
 estimate 'AA' attend*tmt_a 1 tmt_a 1 ;
 estimate 'AD' attend*tmt_d 1 tmt_d 1 ;
 estimate 'AN' attend*tmt_n 1 tmt_n 1 ;
run;

The Mixed Procedure

         Covariance Parameter Estimates
Cov Parm    Subject    Group            Estimate
UN(1,1)     id         cs attender        0.3800
UN(2,1)     id         cs attender        0.3599
UN(2,2)     id         cs attender        0.4801
UN(3,1)     id         cs attender        0.3360
UN(3,2)     id         cs attender        0.3390
UN(3,3)     id         cs attender        0.3980
UN(4,1)     id         cs attender        0.2244
UN(4,2)     id         cs attender        0.2959
UN(4,3)     id         cs attender        0.2655
UN(4,4)     id         cs attender        0.3582
UN(1,1)     id         cs distracter      0.5874
UN(2,1)     id         cs distracter      0.3621
UN(2,2)     id         cs distracter      0.6100
UN(3,1)     id         cs distracter      0.5769
UN(3,2)     id         cs distracter      0.4978
UN(3,3)     id         cs distracter      0.8828
UN(4,1)     id         cs distracter      0.3323
UN(4,2)     id         cs distracter      0.4283
UN(4,3)     id         cs distracter      0.5878
UN(4,4)     id         cs distracter      0.6941

           Fit Statistics
-2 Res Log Likelihood           361.2
AIC (smaller is better)         401.2
AICC (smaller is better)        405.1
BIC (smaller is better)         444.4

  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
    19        189.96          <.0001

                    Solution for Fixed Effects
                            Standard
Effect          Estimate       Error      DF    t Value    Pr > |t|
Intercept         3.5252      0.1214      62      29.05      <.0001
attend           -0.3483      0.1614      62      -2.16      0.0348
tmt_a            -0.1413      0.1637     175      -0.86      0.3895
tmt_d             0.4777      0.1565     175       3.05      0.0026
tmt_n            -0.3339      0.1691     175      -1.97      0.0499
attend*tmt_a      0.2451      0.2061     175       1.19      0.2359
attend*tmt_d     -0.4042      0.2004     175      -2.02      0.0452
attend*tmt_n      0.3334      0.2111     175       1.58      0.1160

                         Estimates
                     Standard
Label    Estimate       Error      DF    t Value    Pr > |t|
DA        -0.1413      0.1637     175      -0.86      0.3895
DD         0.4777      0.1565     175       3.05      0.0026
DN        -0.3339      0.1691     175      -1.97      0.0499
AA         0.1039      0.1251     175       0.83      0.4076
AD        0.07351      0.1251     175       0.59      0.5577
AN       -0.00047      0.1263     175      -0.00      0.9970

*Bottom MODEL;
proc mixed data = pain2 method = reml noclprint noitprint noinfo;
 class id trial cs;
 model logpain = attend tmt_a tmt_d tmt_n attend*tmt_a attend*tmt_d attend*tmt_n/ notest solution;
 repeated trial / subject = id type = cs group=cs;
 estimate 'DA' tmt_a 1 ;
 estimate 'DD' tmt_d 1 ;
 estimate 'DN' tmt_n 1 ;
 estimate 'AA' attend*tmt_a 1 tmt_a 1 ;
 estimate 'AD' attend*tmt_d 1 tmt_d 1 ;
 estimate 'AN' attend*tmt_n 1 tmt_n 1 ;
run;
The Mixed Procedure
         Covariance Parameter Estimates
Cov Parm     Subject    Group            Estimate
Variance     id         cs attender       0.09966
CS           id         cs attender        0.3004
Variance     id         cs distracter      0.2294
CS           id         cs distracter      0.4630

           Fit Statistics
-2 Res Log Likelihood           391.7
AIC (smaller is better)         399.7
AICC (smaller is better)        399.9
BIC (smaller is better)         408.4


  Null Model Likelihood Ratio Test
    DF    Chi-Square      Pr > ChiSq
     3        159.40          <.0001

                    Solution for Fixed Effects
                            Standard
Effect          Estimate       Error      DF    t Value    Pr > |t|

Intercept         3.4736      0.1305      62      26.62      <.0001
attend           -0.3307      0.1659      62      -1.99      0.0507
tmt_a            -0.2440      0.1727     175      -1.41      0.1596
tmt_d             0.4035      0.1648     175       2.45      0.0153
tmt_n            -0.3388      0.1758     175      -1.93      0.0556
attend*tmt_a      0.3171      0.2071     175       1.53      0.1276
attend*tmt_d     -0.3730      0.2006     175      -1.86      0.0646
attend*tmt_n      0.2652      0.2100     175       1.26      0.2083

                         Estimates
                     Standard
Label    Estimate       Error      DF    t Value    Pr > |t|

DA        -0.2440      0.1727     175      -1.41      0.1596
DD         0.4035      0.1648     175       2.45      0.0153
DN        -0.3388      0.1758     175      -1.93      0.0556
AA        0.07308      0.1143     175       0.64      0.5234
AD        0.03046      0.1143     175       0.27      0.7902
AN       -0.07359      0.1148     175      -0.64      0.5225
[http://www.ats.ucla.edu/stat/sas/footer.htm]