1          ************************************************************************;
2          *** EXST7034 Example 1 using PC-SAS - Toluca Company Example         ***;
3          *** Problem from Neter, Kutner, Nachtsheim & Wasserman 1996, #1.21   ***;
4          ************************************************************************;
5          ODS HTML style=minimal rs=none
6              body='C:\Geaghan\EXST\EXST7034New\Fall2002\SAS\03b-Toluca-Nknw1-Ex.html' ;
NOTE: Writing HTML Body file: C:\Geaghan\EXST\EXST7034New\Fall2002\SAS\03b-Toluca-Nknw1-Ex.html
9          OPTIONS LS=155 PS=256 NOCENTER NODATE NONUMBER;
10         DATA ONE; INFILE CARDS MISSOVER;
11              TITLE1 'EXST7034 - Chapter 3 examples : Toluca example';
12         *     LABEL X = 'Lot size';
13         *     LABEL Y = 'work hours';
14            INPUT X Y;
15            group = 'Upper'; If X lt 80 then group = 'Lower';
16            anotherX = X;
17         CARDS;
NOTE: The data set WORK.ONE has 25 observations and 4 variables.
NOTE: DATA statement used:
      real time           0.10 seconds
43         ;
44         PROC SORT; BY group X Y; run;
NOTE: There were 25 observations read from the data set WORK.ONE.
NOTE: The data set WORK.ONE has 25 observations and 4 variables.
NOTE: PROCEDURE SORT used:      real time           0.05 seconds
45         PROC REG DATA=ONE lineprinter; id x;
46            TITLE2 'Regression Models done with SAS REG procedure';
47            MODEL  Y = X / XPX I P CLM CLI R CLB alpha=0.01;
48            TEST X = 5;
49            OUTPUT OUT=Next2 PREDICTED=YHat RESIDUAL=E;   RUN;
NOTE: 25 observations read.
NOTE: 25 observations used in computations.
50            OPTIONS PS=35 ls=80; PLOT Y*X='O' PREDICTED.*X='P'/ OVERLAY;
51                           PLOT RESIDUAL.*X='e';        RUN;
NOTE: The data set WORK.NEXT2 has 25 observations and 6 variables.
NOTE: The PROCEDURE REG printed pages 1-6.
NOTE: PROCEDURE REG used:      real time           0.17 seconds

EXST7034 - Chapter 3 examples : Toluca example
Regression Models done with SAS REG procedure

The REG Procedure
Model: MODEL1
                Model Crossproducts X'X X'Y Y'Y
Variable          Intercept                 X                 Y
Intercept                25              1750              7807
X                      1750            142300            617180
Y                      7807            617180           2745173

           X'X Inverse, Parameter Estimates, and SSE
Variable          Intercept                 X                 Y
Intercept      0.2874747475      -0.003535354      62.365858586
X              -0.003535354      0.0000505051      3.5702020202
Y              62.365858586      3.5702020202      54825.459192

Analysis of Variance                Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     1         252378         252378     105.88    <.0001
Error                    23          54825     2383.71562
Corrected Total          24         307203

Root MSE             48.82331    R-Square     0.8215
Dependent Mean      312.28000    Adj R-Sq     0.8138
Coeff Var            15.63447

                                       Parameter Estimates
                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|       99% Confidence Limits
Intercept     1       62.36586       26.17743       2.38      0.0259      -11.12299      135.85470
X             1        3.57020        0.34697      10.29      <.0001        2.59613        4.54427EXST7034 - Chapter 3 examples : Toluca example
Regression Models done with SAS REG procedure

The REG Procedure
Model: MODEL1
Dependent Variable: Y

                                                                Output Statistics
                    Dep Var Predicted    Std Error                                                   Std Error  Student                   Cook's
     Obs X                Y     Value Mean Predict     99% CL Mean        99% CL Predict    Residual  Residual Residual   -2-1 0 1 2           D
       1       20  113.0000  133.7699      19.9079   77.8819  189.6579  -14.2499  281.7897  -20.7699    44.580   -0.466 |      |      |    0.022
       2       30  121.0000  169.4719      16.9697  121.8322  217.1117   24.3653  314.5785  -48.4719    45.779   -1.059 |    **|      |    0.077
       3       30  212.0000  169.4719      16.9697  121.8322  217.1117   24.3653  314.5785   42.5281    45.779    0.929 |      |*     |    0.059
       4       30  273.0000  169.4719      16.9697  121.8322  217.1117   24.3653  314.5785  103.5281    45.779    2.261 |      |****  |    0.351
       5       40  160.0000  205.1739      14.2723  165.1067  245.2412   62.3742  347.9737  -45.1739    46.691   -0.968 |     *|      |    0.044
       6       40  244.0000  205.1739      14.2723  165.1067  245.2412   62.3742  347.9737   38.8261    46.691    0.832 |      |*     |    0.032
       7       50  157.0000  240.8760      11.9793  207.2459  274.5060   99.7471  382.0048  -83.8760    47.331   -1.772 |   ***|      |    0.101
       8       50  221.0000  240.8760      11.9793  207.2459  274.5060   99.7471  382.0048  -19.8760    47.331   -0.420 |      |      |    0.006
       9       50  268.0000  240.8760      11.9793  207.2459  274.5060   99.7471  382.0048   27.1240    47.331    0.573 |      |*     |    0.011
      10       60  224.0000  276.5780      10.3628  247.4861  305.6698  136.4612  416.6948  -52.5780    47.711   -1.102 |    **|      |    0.029
      11       70  252.0000  312.2800       9.7647  284.8673  339.6927  172.5022  452.0578  -60.2800    47.837   -1.260 |    **|      |    0.033
      12       70  323.0000  312.2800       9.7647  284.8673  339.6927  172.5022  452.0578   10.7200    47.837    0.224 |      |      |    0.001
      13       70  361.0000  312.2800       9.7647  284.8673  339.6927  172.5022  452.0578   48.7200    47.837    1.018 |      |**    |    0.022
      14       80  342.0000  347.9820      10.3628  318.8902  377.0739  207.8652  488.0988   -5.9820    47.711   -0.125 |      |      |    0.000
      15       80  352.0000  347.9820      10.3628  318.8902  377.0739  207.8652  488.0988    4.0180    47.711   0.0842 |      |      |    0.000
      16       80  399.0000  347.9820      10.3628  318.8902  377.0739  207.8652  488.0988   51.0180    47.711    1.069 |      |**    |    0.027
      17       90  376.0000  383.6840      11.9793  350.0540  417.3141  242.5552  524.8129   -7.6840    47.331   -0.162 |      |      |    0.001
      18       90  377.0000  383.6840      11.9793  350.0540  417.3141  242.5552  524.8129   -6.6840    47.331   -0.141 |      |      |    0.001
      19       90  389.0000  383.6840      11.9793  350.0540  417.3141  242.5552  524.8129    5.3160    47.331    0.112 |      |      |    0.000
      20       90  468.0000  383.6840      11.9793  350.0540  417.3141  242.5552  524.8129   84.3160    47.331    1.781 |      |***   |    0.102
      21      100  353.0000  419.3861      14.2723  379.3188  459.4533  276.5863  562.1858  -66.3861    46.691   -1.422 |    **|      |    0.094
      22      100  420.0000  419.3861      14.2723  379.3188  459.4533  276.5863  562.1858    0.6139    46.691   0.0131 |      |      |    0.000
      23      110  421.0000  455.0881      16.9697  407.4483  502.7278  309.9815  600.1947  -34.0881    45.779   -0.745 |     *|      |    0.038
      24      110  435.0000  455.0881      16.9697  407.4483  502.7278  309.9815  600.1947  -20.0881    45.779   -0.439 |      |      |    0.013
      25      120  546.0000  490.7901      19.9079  434.9021  546.6781  342.7703  638.8099   55.2099    44.580    1.238 |      |**    |    0.153

Sum of Residuals                           0
Sum of Squared Residuals               54825
Predicted Residual SS (PRESS)          65818



Test 1 Results for Dependent Variable Y
                                Mean
Source             DF         Square    F Value    Pr > F
Numerator           1          40478      16.98    0.0004
Denominator        23     2383.71562


EXST7034 - Chapter 3 examples : Toluca example
Regression Models done with SAS REG procedure

The REG Procedure
Model: MODEL1
Dependent Variable: Y

    --+------+------+------+------+------+------+------+------+------+------+---
  Y |                                                                          |
600 +                                                                          +
    |                                                                          |
    |                                                                       O  |
    |                                                                       P  |
    |                                                  O             P         |
    |                                                         ?      O         |
400 +                                           O      ?                       +
    |                                    O      O      O      O                |
    |                                    O      ?                              |
    |                                    P                                     |
    |        O             O      P      O                                     |
    |               O      ?      O                                            |
200 +        O      P                                                          +
    |        P      O      O                                                   |
    | P      O                                                                 |
    | O                                                                        |
    |                                                                          |
    |                                                                          |
  0 +                                                                          +
    |                                                                          |
    --+------+------+------+------+------+------+------+------+------+------+---
     20     30     40     50     60     70     80     90     100    110    120
                                         X

           ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+----
       100 +         e                                                         +
           |                                                                   |
           |                                             e                     |
           |                                                                   |
           |                                                               e   |
        50 +                                 e     e                           +
R          |         e     e                                                   |
e RESIDUAL |                     e                                             |
s          |                                                                   |
i          |                                 e           e                     |
d        0 +                                       e           e               +
u          |                                       e     e                     |
a          |   e                 e                                   e         |
l          |                                                         e         |
           |                                                                   |
       -50 +         e     e           e                                       +
           |                                 e                                 |
           |                                                   e               |
           |                     e                                             |
           |                                                                   |
      -100 +                                                                   +
           ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+----
              20    30    40    50    60    70    80    90    100   110   120
                                             X

52         PROC PLOT DATA=Next2;  PLOT E*X='x' / VREF=0; RUN;
53         OPTIONS PS=256 ls=88;
NOTE: There were 25 observations read from the data set WORK.NEXT2.
NOTE: The PROCEDURE PLOT printed page 7.
NOTE: PROCEDURE PLOT used:
      real time           0.00 seconds
EXST7034 - Chapter 3 examples : Toluca example
Regression Models done with SAS REG procedure

                       Plot of E*X.  Symbol used is 'x'.
       |
       |
   100 +       x
       |
       |                                                 x
       |
       |                                                                      x
    50 +                                   x      x
R      |       x      x
e      |                     x
s      |
i      |                                   x             x
d    0 +------------------------------------------x-------------x---------------
u      |                                          x      x
a      |x                    x                                         x
l      |                                                               x
       |
   -50 +       x      x             x
       |                                   x
       |                                                        x
       |                     x
       |
  -100 +
       |
       -+------+------+------+------+------+------+------+------+------+------+-
       20     30     40     50     60     70     80     90     100    110    120
                                           X
NOTE: 1 obs hidden.


55         PROC UNIVARIATE DATA=Next2 PLOT NORMAL; VAR E; RUN;

NOTE: The PROCEDURE UNIVARIATE printed page 8.
NOTE: PROCEDURE UNIVARIATE used:
      real time           0.00 seconds

EXST7034 - Chapter 3 examples : Toluca example
Regression Models done with SAS REG procedure

The UNIVARIATE Procedure
Variable:  E  (Residual)
                            Moments
N                          25    Sum Weights                 25
Mean                        0    Sum Observations             0
Std Deviation      47.7953359    Variance            2284.39413
Skewness           0.31691262    Kurtosis            -0.3941493
Uncorrected SS     54825.4592    Corrected SS        54825.4592
Coeff Variation             .    Std Error Mean      9.55906718

              Basic Statistical Measures
    Location                    Variability
Mean      0.00000     Std Deviation           47.79534
Median   -5.98202     Variance                    2284
Mode       .          Range                  187.40404
                      Interquartile Range     72.91414

           Tests for Location: Mu0=0
Test           -Statistic-    -----p Value------
Student's t    t         0    Pr > |t|    1.0000
Sign           M      -0.5    Pr >= |M|   1.0000
Signed Rank    S      -7.5    Pr >= |S|   0.8448
                   Tests for Normality
Test                  --Statistic---    -----p Value------
Shapiro-Wilk          W     0.978904    Pr < W      0.8626
Kolmogorov-Smirnov    D      0.09572    Pr > D     >0.1500
Cramer-von Mises      W-Sq  0.033263    Pr > W-Sq  >0.2500
Anderson-Darling      A-Sq  0.207142    Pr > A-Sq  >0.2500

Quantiles (Definition 5)
Quantile        Estimate
100% Max       103.52808
99%            103.52808
95%             84.31596
90%             55.20990
75% Q3          38.82606
50% Median      -5.98202
25% Q1         -34.08808
10%            -60.28000
5%             -66.38606
1%             -83.87596
0% Min         -83.87596

            Extreme Observations
------Lowest-----        ------Highest-----
   Value      Obs            Value      Obs
-83.8760        7          48.7200       13
-66.3861       21          51.0180       16
-60.2800       11          55.2099       25
-52.5780       10          84.3160       20
-48.4719        2         103.5281        4

   Stem Leaf                     #  Boxplot
     10 4                        1     |
      8 4                        1     |
      6                                |
      4 3915                     4     |
      2 79                       2  +-----+
      0 1451                     4  |  +  |
     -0 876                      3  *-----*
     -2 4100                     4  +-----+
     -4 385                      3     |
     -6 60                       2     |
     -8 4                        1     |
        ----+----+----+----+
    Multiply Stem.Leaf by 10**+1

                       Normal Probability Plot
     110+                                             *+++++
        |                                        * ++++
        |                                      ++++
        |                                 **+*+*
        |                              **++
      10+                         +****
        |                     +****
        |                 ++***
        |             +*+**
        |         +*+*
     -90+     *+++
         +----+----+----+----+----+----+----+----+----+----+
             -2        -1         0        +1        +2

 57         PROC SORT; BY group X Y; run;
NOTE: There were 25 observations read from the data set WORK.NEXT2.
NOTE: The data set WORK.NEXT2 has 25 observations and 6 variables.
NOTE: PROCEDURE SORT used:
      real time           0.04 seconds
58         PROC means data=next2 noprint; BY group; var e;
59                OUTPUT OUT=NEXT3 median=med;
60         run;
NOTE: There were 25 observations read from the data set WORK.NEXT2.
NOTE: The data set WORK.NEXT3 has 2 observations and 4 variables.
NOTE: PROCEDURE MEANS used:
      real time           0.06 seconds
61         data next2; merge next2 next3; by group;
62            absE = abs(e);
63            esquared = e*e;
64            logesq = log(esquared);
65            logX = Log(X);
66            leveneTest = abs(e - med);
67            drop  _TYPE_  _FREQ_;
68         run;
NOTE: There were 25 observations read from the data set WORK.NEXT2.
NOTE: There were 2 observations read from the data set WORK.NEXT3.
NOTE: The data set WORK.NEXT2 has 25 observations and 12 variables.
NOTE: DATA statement used:
      real time           0.00 seconds
69         proc print data=next2; run;
NOTE: There were 25 observations read from the data set WORK.NEXT2.
NOTE: The PROCEDURE PRINT printed page 9.
NOTE: PROCEDURE PRINT used:
      real time           0.04 seconds

EXST7034 - Chapter 3 examples : Toluca example
Regression Models done with SAS REG procedure
                                                                                       l
                                                                                       e
                  a                                           e                        v
                  n                                           s                        e
                  o                                           q     l                  n
             g    t                                           u     o                  e
             r    h     Y                            a        a     g       l          T
 O           o    e     H                 m          b        r     e       o          e
 b           u    r     a                 e          s        e     s       g          s
 s  X   Y    p    X     t           E     d          E        d     q       X          t
 1  20 113 Lower  20 133.770  -20.770 -19.8760  20.770   431.39  6.06701 2.99573   0.894
 2  30 121 Lower  30 169.472  -48.472 -19.8760  48.472  2349.53  7.76197 3.40120  28.596
 3  30 212 Lower  30 169.472   42.528 -19.8760  42.528  1808.64  7.50033 3.40120  62.404
 4  30 273 Lower  30 169.472  103.528 -19.8760 103.528 10718.06  9.27969 3.40120 123.404
 5  40 160 Lower  40 205.174  -45.174 -19.8760  45.174  2040.68  7.62104 3.68888  25.298
 6  40 244 Lower  40 205.174   38.826 -19.8760  38.826  1507.46  7.31818 3.68888  58.702
 7  50 157 Lower  50 240.876  -83.876 -19.8760  83.876  7035.18  8.85868 3.91202  64.000
 8  50 221 Lower  50 240.876  -19.876 -19.8760  19.876   395.05  5.97902 3.91202   0.000
 9  50 268 Lower  50 240.876   27.124 -19.8760  27.124   735.71  6.60084 3.91202  47.000
10  60 224 Lower  60 276.578  -52.578 -19.8760  52.578  2764.44  7.92459 4.09434  32.702
11  70 252 Lower  70 312.280  -60.280 -19.8760  60.280  3633.68  8.19800 4.24850  40.404
12  70 323 Lower  70 312.280   10.720 -19.8760  10.720   114.92  4.74422 4.24850  30.596
13  70 361 Lower  70 312.280   48.720 -19.8760  48.720  2373.64  7.77218 4.24850  68.596
14  80 342 Upper  80 347.982   -5.982  -2.6840   5.982    35.78  3.57752 4.38203   3.298
15  80 352 Upper  80 347.982    4.018  -2.6840   4.018    16.14  2.78156 4.38203   6.702
16  80 399 Upper  80 347.982   51.018  -2.6840  51.018  2602.83  7.86436 4.38203  53.702
17  90 376 Upper  90 383.684   -7.684  -2.6840   7.684    59.04  4.07829 4.49981   5.000
18  90 377 Upper  90 383.684   -6.684  -2.6840   6.684    44.68  3.79945 4.49981   4.000
19  90 389 Upper  90 383.684    5.316  -2.6840   5.316    28.26  3.34143 4.49981   8.000
20  90 468 Upper  90 383.684   84.316  -2.6840  84.316  7109.18  8.86914 4.49981  87.000
21 100 353 Upper 100 419.386  -66.386  -2.6840  66.386  4407.11  8.39097 4.60517  63.702
22 100 420 Upper 100 419.386    0.614  -2.6840   0.614     0.38 -0.97572 4.60517   3.298
23 110 421 Upper 110 455.088  -34.088  -2.6840  34.088  1162.00  7.05790 4.70048  31.404
24 110 435 Upper 110 455.088  -20.088  -2.6840  20.088   403.53  6.00025 4.70048  17.404
25 120 546 Upper 120 490.790   55.210  -2.6840  55.210  3048.13  8.02228 4.78749  57.894
70         proc ttest data=next2;
71             TITLE2 'TTest for the Modified Levene test';
72              class group; var leveneTest;
73         run;
NOTE: There were 25 observations read from the data set WORK.NEXT2.
NOTE: The PROCEDURE TTEST printed page 10.
NOTE: PROCEDURE TTEST used:
      real time           0.00 seconds


EXST7034 - Chapter 3 examples : Toluca example
TTest for the Modified Levene test

The TTEST Procedure
                                      Statistics
                               Lower CL          Upper CL  Lower CL           Upper CL
Variable    group           N      Mean    Mean      Mean   Std Dev  Std Dev   Std Dev
leveneTest  Lower          13     25.26  44.815     64.37    23.205   32.361    53.419
leveneTest  Upper          12    9.6702   28.45     47.23    20.939   29.558    50.186
leveneTest  Diff (1-2)            -9.35  16.365     42.08    24.134   31.052    43.558

                     Statistics
Variable    group       Std Err    Minimum    Maximum
leveneTest  Lower        8.9753          0      123.4
leveneTest  Upper        8.5326      3.298         87
leveneTest  Diff (1-2)   12.431

                                T-Tests
Variable      Method           Variances      DF    t Value    Pr > |t|
leveneTest    Pooled           Equal          23       1.32      0.2010
leveneTest    Satterthwaite    Unequal        23       1.32      0.1993

                     Equality of Variances
Variable      Method      Num DF    Den DF    F Value    Pr > F
leveneTest    Folded F        12        11       1.20    0.7710



75         proc npar1way data=next2;
76            TITLE2 'Nonparametric analysis of abs(residuals)';
77            TITLE3 'Other tests of residuals for homogeneity';
78            class group; var abse;
79         run;
NOTE: There were 25 observations read from the data set WORK.NEXT2.
NOTE: The PROCEDURE NPAR1WAY printed pages 11-16.
NOTE: PROCEDURE NPAR1WAY used:
      real time           0.00 seconds
80         proc npar1way data=next2;
81            TITLE2 'Nonparametric analysis of abs(residuals)';
82            TITLE3 'Other tests of residuals for homogeneity';
83            class group; var e;
84         run;
NOTE: There were 25 observations read from the data set WORK.NEXT2.
NOTE: The PROCEDURE NPAR1WAY printed pages 17-22.
NOTE: PROCEDURE NPAR1WAY used:
      real time           0.04 seconds
 EXST7034 - Chapter 3 examples : Toluca example
Nonparametric analysis of abs(residuals)
Other tests of residuals for homogeneity

The NPAR1WAY Procedure

Analysis of Variance for Variable absE
     Classified by Variable group
group             N                Mean
Lower            13           46.343994
Upper            12           28.450337

Source    DF    Sum of Squares    Mean Square     F Value    Pr > F
Among      1       1997.941694    1997.941694      2.6730    0.1157
Within    23      17191.444414     747.454105

            Wilcoxon Scores (Rank Sums) for Variable absE
                    Classified by Variable group
                     Sum of      Expected       Std Dev          Mean
group       N        Scores      Under H0      Under H0         Score
Lower      13         199.0         169.0     18.384776     15.307692
Upper      12         126.0         156.0     18.384776     10.500000


   Wilcoxon Two-Sample Test
Statistic             126.0000
Normal Approximation
Z                      -1.6046
One-Sided Pr <  Z       0.0543
Two-Sided Pr > |Z|      0.1086

t Approximation
One-Sided Pr <  Z       0.0608
Two-Sided Pr > |Z|      0.1217
Z includes a continuity correction of 0.5.

     Kruskal-Wallis Test
Chi-Square              2.6627
DF                           1
Pr > Chi-Square         0.1027

   Median Scores (Number of Points Above Median) for Variable absE
                    Classified by Variable group
                     Sum of      Expected       Std Dev          Mean
group       N        Scores      Under H0      Under H0         Score
Lower      13           8.0         6.240      1.273735      0.615385
Upper      12           4.0         5.760      1.273735      0.333333

   Median Two-Sample Test
Statistic              4.0000
Z                     -1.3818
One-Sided Pr <  Z      0.0835
Two-Sided Pr > |Z|     0.1670

   Median One-Way Analysis
Chi-Square             1.9093
DF                          1
Pr > Chi-Square        0.1670

          Van der Waerden Scores (Normal) for Variable absE
                    Classified by Variable group
                     Sum of      Expected       Std Dev          Mean
group       N        Scores      Under H0      Under H0         Score
Lower      13      3.826510           0.0      2.264058      0.294347
Upper      12     -3.826510           0.0      2.264058     -0.318876

Van der Waerden Two-Sample Test
Statistic             -3.8265
Z                     -1.6901
One-Sided Pr <  Z      0.0455
Two-Sided Pr > |Z|     0.0910

Van der Waerden One-Way Analysis
Chi-Square             2.8565
DF                          1
Pr > Chi-Square        0.0910

            Savage Scores (Exponential) for Variable absE
                    Classified by Variable group
                     Sum of      Expected       Std Dev          Mean
group       N        Scores      Under H0      Under H0         Score
Lower      13      2.470789           0.0      2.346881      0.190061
Upper      12     -2.470789           0.0      2.346881     -0.205899

   Savage Two-Sample Test
Statistic             -2.4708
Z                     -1.0528
One-Sided Pr <  Z      0.1462
Two-Sided Pr > |Z|     0.2924

   Savage One-Way Analysis
Chi-Square             1.1084
DF                          1
Pr > Chi-Square        0.2924

    Kolmogorov-Smirnov Test for Variable absE
           Classified by Variable group
                     EDF at    Deviation from Mean
group       N       Maximum        at Maximum
Lower      13         0.000         -0.865332
Upper      12         0.500          0.900666
Total      25         0.240
Maximum Deviation Occurred at Observation 17
       Value of absE at Maximum = 7.684040

Kolmogorov-Smirnov Two-Sample Test (Asymptotic)
KS   0.249800    D         0.500000
KSa  1.249000    Pr > KSa  0.0883

Cramer-von Mises Test for Variable absE
     Classified by Variable group
                       Summed Deviation
group          N           from Mean
Lower         13            0.192246
Upper         12            0.208267

Cramer-von Mises Statistics (Asymptotic)
CM  0.016021    CMa  0.400513

Kuiper Test for Variable absE
Classified by Variable group
                    Deviation
group        N      from Mean
Lower       13       0.025641
Upper       12       0.500000

     Kuiper Two-Sample Test (Asymptotic)
K  0.525641    Ka  1.313051    Pr > Ka  0.3751

86         TITLE2 'Other tests for homogeneity of residuals';
87         proc reg data=next2; TITLE3 'SLR'; model Y = x; run;
NOTE: 25 observations read.
NOTE: 25 observations used in computations.
NOTE: The PROCEDURE REG printed page 23.
NOTE: PROCEDURE REG used:       real time           0.05 seconds
88         proc reg data=next2; TITLE3 'e*e on X'; model esquared = x; run;
NOTE: 25 observations read.
NOTE: 25 observations used in computations.
NOTE: The PROCEDURE REG printed page 24.
NOTE: PROCEDURE REG used:       real time           0.00 seconds

EXST7034 - Chapter 3 examples : Toluca example
Other tests for homogeneity of residuals
SLR

The REG Procedure
Model: MODEL1
Dependent Variable: Y

Analysis of Variance                Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     1         252378         252378     105.88    <.0001
Error                    23          54825     2383.71562
Corrected Total          24         307203

Root MSE             48.82331    R-Square     0.8215
Dependent Mean      312.28000    Adj R-Sq     0.8138
Coeff Var            15.63447

                        Parameter Estimates
                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|
Intercept     1       62.36586       26.17743       2.38      0.0259
X             1        3.57020        0.34697      10.29      <.0001

Other tests for homogeneity of residuals
e*e on X
Dependent Variable: esquared

Analysis of Variance                Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     1        7896142        7896142       1.09    0.3070
Error                    23      166395896        7234604
Corrected Total          24      174292038

Root MSE           2689.72195    R-Square     0.0453
Dependent Mean     2193.01837    Adj R-Sq     0.0038
Coeff Var           122.64931

                        Parameter Estimates
                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|
Intercept     1     3590.90811     1442.13939       2.49      0.0204
X             1      -19.96985       19.11502      -1.04      0.3070
Breusch-Pagan Test -  
P(>Chi square with 1 d.f.) = 0.364907535493054  
89         proc reg data=next2; TITLE3 'log(e*e) on X'; model logesq = x; run;
NOTE: 25 observations read.
NOTE: 25 observations used in computations.
NOTE: The PROCEDURE REG printed page 25.
NOTE: PROCEDURE REG used:
      real time           0.05 seconds
90         proc reg data=next2; TITLE3 'Log(e*e) on log(X)'; model logesq = logx;
NOTE: 25 observations read.
NOTE: 25 observations used in computations.
91         options ps=55;
NOTE: The PROCEDURE REG printed page 26.
NOTE: PROCEDURE REG used:
      real time           0.05 seconds

EXST7034 - Chapter 3 examples : Toluca example
Other tests for homogeneity of residuals
log(e*e) on X

The REG Procedure
Model: MODEL1
Dependent Variable: logesq

                             Analysis of Variance
                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     1       15.35148       15.35148       2.78    0.1093
Error                    23      127.19606        5.53026
Corrected Total          24      142.54754

Root MSE              2.35165    R-Square     0.1077
Dependent Mean        6.33733    Adj R-Sq     0.0689
Coeff Var            37.10793

                        Parameter Estimates
                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|
Intercept     1        8.28646        1.26088       6.57      <.0001
X             1       -0.02784        0.01671      -1.67      0.1093

Log(e*e) on log(X)
Dependent Variable: logesq

Analysis of Variance                Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     1       15.55203       15.55203       2.82    0.1068
Error                    23      126.99551        5.52154
Corrected Total          24      142.54754

Root MSE              2.34980    R-Square     0.1091
Dependent Mean        6.33733    Adj R-Sq     0.0704
Coeff Var            37.07867

                        Parameter Estimates
                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|
Intercept     1       13.17710        4.10248       3.21      0.0039
logX          1       -1.64898        0.98254      -1.68      0.1068

91                        PROC PLOT DATA=next2;  PLOT e*x / href=75 vref=0; RUN;
NOTE: There were 25 observations read from the data set WORK.NEXT2.
NOTE: The PROCEDURE PLOT printed page 27.
NOTE: PROCEDURE PLOT used:      real time           0.00 seconds
92                        PROC PLOT DATA=next2;  PLOT logesq*logx / href=4.32; RUN;
NOTE: There were 25 observations read from the data set WORK.NEXT2.
NOTE: The PROCEDURE PLOT printed page 28.
NOTE: PROCEDURE PLOT used:      real time           0.00 seconds


EXST7034 - Chapter 3 examples : Toluca example
Other tests for homogeneity of residuals
Log(e*e) on log(X)
                    Plot of E*X.  Legend: A = 1 obs, B = 2 obs, etc.
         |                                         |
     125 +                                         |
         |                                         |
         |                                         |
         |         A                               |
     100 +                                         |
         |                                         |
         |                                         |
         |                                         |         A
      75 +                                         |
         |                                         |
         |                                         |
         |                                         |                              A
      50 +                                     A   |  A
         |         A                               |
  R      |                A                        |
  e      |                                         |
  s   25 +                       A                 |
  i      |                                         |
  d      |                                     A   |
  u      |                                         |  A      A
  a    0 +-----------------------------------------+----------------A----------------
  l      |                                         |  A      B
         |                                         |
         |  A                    A                 |                       A
     -25 +                                         |
         |                                         |                       A
         |                                         |
         |                A                        |
     -50 +         A                    A          |
         |                                         |
         |                                     A   |
         |                                         |                A
     -75 +                                         |
         |                       A                 |
         |                                         |
         |                                         |
    -100 +                                         |
         ---+------+------+------+------+------+------+------+------+------+------+--
           20     30     40     50     60     70     80     90     100    110    120
                                               X

Log(e*e) on log(X)
                Plot of logesq*logX.  Legend: A = 1 obs, B = 2 obs, etc.
         10 +                                            |
            |                                            |
            |                                            |
            |               A                            |
            |                               A            |     A
            |                                            |
            |                                          A |        A
          8 +                                     A      | A            A
            |               A        A                 A |
            |               A        A                   |
            |                                            |           A
            |                                            |
            |                               A            |
            |                                            |
          6 +  A                            A            |           A
            |                                            |
            |                                            |
     logesq |                                            |
            |                                          A |
            |                                            |
            |                                            |
          4 +                                            |     A
            |                                            | A   A
            |                                            |     A
            |                                            |
            |                                            | A
            |                                            |
            |                                            |
          2 +                                            |
            |                                            |
            |                                            |
            |                                            |
            |                                            |
            |                                            |
            |                                            |
          0 +                                            |
            |                                            |
            |                                            |
            |                                            |        A
            |                                            |
            ---+---------------+---------------+---------------+---------------+--
              3.0             3.5             4.0             4.5             5.0
                                             logX
94         proc freq data=one; table x / NOROW NOCOL NOPERCENT; run;
NOTE: There were 25 observations read from the data set WORK.ONE.
NOTE: The PROCEDURE FREQ printed page 29.
NOTE: PROCEDURE FREQ used:
      real time           0.04 seconds


EXST7034 - Chapter 3 examples : Toluca example
Other tests for homogeneity of residuals
Log(e*e) on log(X)

The FREQ Procedure
                    Cumulative
  X    Frequency     Frequency
------------------------------
 20           1             1
 30           3             4
 40           2             6
 50           3             9
 60           1            10
 70           3            13
 80           3            16
 90           4            20
100           2            22
110           2            24
120           1            25

95         proc mixed DATA=ONE;  CLASSES AnotherX;
96            title2 'Analysis of Lack of Fit using PROC MIXED - Full Model';
97            model Y = AnotherX / htype=1 3 DDFM=Satterthwaite solution;
98         run;
NOTE: The PROCEDURE MIXED printed pages 30-31.
NOTE: PROCEDURE MIXED used:
      real time           0.05 seconds

EXST7034 - Chapter 3 examples : Toluca example
Analysis of Lack of Fit using PROC MIXED - Full Model

The Mixed Procedure
                  Model Information
Data Set                     WORK.ONE
Dependent Variable           Y
Covariance Structure         Diagonal
Estimation Method            REML
Residual Variance Method     Profile
Fixed Effects SE Method      Model-Based
Degrees of Freedom Method    Residual

              Class Level Information
Class       Levels    Values
anotherX        11    20 30 40 50 60 70 80 90 100 110 120

            Dimensions
Covariance Parameters             1
Columns in X                     12
Columns in Z                      0
Subjects                          1
Max Obs Per Subject              25
Observations Used                25
Observations Not Used             0
Total Observations               25
EXST7034 - Chapter 3 examples : Toluca example
Analysis of Lack of Fit using PROC MIXED - Full Model

The Mixed Procedure

Covariance Parameter Estimates
Cov Parm     Estimate
Residual      2684.35

           Fit Statistics
-2 Res Log Likelihood           158.1
AIC (smaller is better)&