UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

SAS Textbook Examples
Regression Analysis by Example by Chatterjee, Hadi and Price
Chapter 11: Variable Selection Procedures

Inputting the Supervisor Performance data, p. 54.
data p054;
  input Y X1 X2 X3 X4 X5 X6 ;
cards;
43 51 30 39 61 92 45 
63 64 51 54 63 73 47 
71 70 68 69 76 86 48 
61 63 45 47 54 84 35 
81 78 56 66 71 83 47 
43 55 49 44 54 49 34 
58 67 42 56 66 68 35 
71 75 50 55 70 66 41 
72 82 72 67 71 83 31 
67 61 45 47 62 80 41 
64 53 53 58 58 67 34 
67 60 47 39 59 74 41 
69 62 57 42 55 63 25 
68 83 83 45 59 77 35 
77 77 54 72 79 77 46 
81 90 50 72 60 54 36 
74 85 64 69 79 79 63 
65 60 65 75 55 80 60 
65 70 46 57 75 85 46 
50 58 68 54 64 78 52 
50 40 33 34 43 64 33 
64 61 52 62 66 80 41 
53 66 52 50 63 80 37 
40 37 42 58 50 57 49 
63 54 42 48 66 75 33 
66 77 66 63 88 76 72 
78 75 58 74 80 78 49 
48 57 44 45 51 83 38 
85 85 71 71 77 74 55 
82 82 39 59 64 78 39 
;
run;
Table 11.1, p. 294. The values in the eigenvalue column are the eigenvalues on the bottom of p. 295.
proc princomp data = p054;
  var x1-x6;
run;
The PRINCOMP Procedure
Observations          30
Variables              6
                                      Simple Statistics

                 X1             X2             X3             X4             X5             X6
Mean    66.60000000    53.13333333    56.36666667    64.63333333    74.76666667    42.93333333
StD     13.31475717    12.23542999    11.73701288    10.39722554     9.89490755    10.28870601

                            Correlation Matrix

            X1          X2          X3          X4          X5          X6
X1      1.0000      0.5583      0.5967      0.6692      0.1877      0.2246
X2      0.5583      1.0000      0.4933      0.4455      0.1472      0.3433
X3      0.5967      0.4933      1.0000      0.6403      0.1160      0.5316
X4      0.6692      0.4455      0.6403      1.0000      0.3769      0.5742
X5      0.1877      0.1472      0.1160      0.3769      1.0000      0.2833
X6      0.2246      0.3433      0.5316      0.5742      0.2833      1.0000
            Eigenvalues of the Correlation Matrix

        Eigenvalue    Difference    Proportion    Cumulative
   1    3.16922321    2.16287646        0.5282        0.5282
   2    1.00634675    0.24343802        0.1677        0.6959
   3    0.76290873    0.21039227        0.1272        0.8231
   4    0.55251646    0.23526997        0.0921        0.9152
   5    0.31724648    0.12548811        0.0529        0.9680
   6    0.19175838                      0.0320        1.0000
                                     Eigenvectors

           Prin1         Prin2         Prin3         Prin4         Prin5         Prin6
X1      0.439375      -.312642      0.445167      -.316019      -.191521      0.611949
X2      0.394711      -.308751      0.217414      0.814847      -.037686      -.190294
X3      0.461401      -.217087      -.271981      -.224796      0.775648      -.117671
X4      0.492658      0.115532      0.005605      -.365108      -.460364      -.631404
X5      0.224813      0.802247      0.457246      0.099947      0.288875      0.057847
X6      0.380801      0.320706      -.686643      0.205742      -.254728      0.416465

The values in the VIF column in the output are the VIF's in middle of p. 295.
proc reg data = p054;
  model y = x1-x6/vif ;
run;
quit;
The REG Procedure
Model: MODEL1
Dependent Variable: Y

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     6     3147.96634      524.66106      10.50    <.0001
Error                    23     1149.00032       49.95654
Corrected Total          29     4296.96667

Root MSE              7.06799    R-Square     0.7326
Dependent Mean       64.63333    Adj R-Sq     0.6628
Coeff Var            10.93552
                                Parameter Estimates

                     Parameter       Standard                              Variance
Variable     DF       Estimate          Error    t Value    Pr > |t|      Inflation
Intercept     1       10.78708       11.58926       0.93      0.3616              0
X1            1        0.61319        0.16098       3.81      0.0009        2.66706
X2            1       -0.07305        0.13572      -0.54      0.5956        1.60089
X3            1        0.32033        0.16852       1.90      0.0699        2.27104
X4            1        0.08173        0.22148       0.37      0.7155        3.07823
X5            1        0.03838        0.14700       0.26      0.7963        1.22811
X6            1       -0.21706        0.17821      -1.22      0.2356        1.95159

Table 11.2, p. 296.
The probability (p-value) for entering was set at .99 so that all the variables will be entered into the model. The reason is that we are mainly interested in the order in which they entered the model.
proc reg data = p054;
  model y = x1-x6/ selection = forward slentry = 0.99;
run;
quit;
The REG Procedure
Model: MODEL1
Dependent Variable: Y

Forward Selection: Step 1
Variable X1 Entered: R-Square = 0.6813 and C(p) = 1.4115
                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     1     2927.58425     2927.58425      59.86    <.0001
Error                    28     1369.38241       48.90651
Corrected Total          29     4296.96667
             Parameter     Standard
Variable      Estimate        Error   Type II SS  F Value  Pr > F
Intercept     14.37632      6.61999    230.64710     4.72  0.0385
X1             0.75461      0.09753   2927.58425    59.86  <.0001

Bounds on condition number: 1, 1
------------------------------------------------------------------------------------------------

Forward Selection: Step 2

Variable X3 Entered: R-Square = 0.7080 and C(p) = 1.1148
                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     2     3042.31770     1521.15885      32.74    <.0001
Error                    27     1254.64897       46.46848
Corrected Total          29     4296.96667
             Parameter     Standard
Variable      Estimate        Error   Type II SS  F Value  Pr > F
Intercept      9.87088      7.06122     90.80512     1.95  0.1735
X1             0.64352      0.11848   1370.90744    29.50  <.0001
X3             0.21119      0.13440    114.73344     2.47  0.1278
Bounds on condition number: 1.553, 6.2121
------------------------------------------------------------------------------------------------

Forward Selection: Step 3

Variable X6 Entered: R-Square = 0.7256 and C(p) = 1.6027
                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     3     3117.85753     1039.28584      22.92    <.0001
Error                    26     1179.10914       45.35035
Corrected Total          29     4296.96667

             Parameter     Standard
Variable      Estimate        Error   Type II SS  F Value  Pr > F
Intercept     13.57774      7.54390    146.90747     3.24  0.0835
X1             0.62273      0.11815   1259.90769    27.78  <.0001
X3             0.31239      0.15420    186.12267     4.10  0.0532
X6            -0.18695      0.14485     75.53983     1.67  0.2082

Bounds on condition number: 2.0946, 15.292
------------------------------------------------------------------------------------------------

Forward Selection: Step 4

Variable X2 Entered: R-Square = 0.7293 and C(p) = 3.2805
                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     4     3133.95504      783.48876      16.84    <.0001
Error                    25     1163.01163       46.52047
Corrected Total          29     4296.96667

             Parameter     Standard
Variable      Estimate        Error   Type II SS  F Value  Pr > F
Intercept     14.30347      7.73957    158.88895     3.42  0.0765
X1             0.65338      0.13051   1165.93982    25.06  <.0001
X2            -0.07682      0.13059     16.09751     0.35  0.5616
X3             0.32395      0.15741    197.03481     4.24  0.0502
X6            -0.17151      0.14904     61.60475     1.32  0.2607

Bounds on condition number: 2.1278, 28.27
------------------------------------------------------------------------------------------------

Forward Selection: Step 5

Variable X4 Entered: R-Square = 0.7318 and C(p) = 5.0682
<                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     5     3144.56048      628.91210      13.10    <.0001
Error                    24     1152.40619       48.01692
Corrected Total          29     4296.96667
             Parameter     Standard
Variable      Estimate        Error   Type II SS  F Value  Pr > F
Intercept     12.79791      8.49061    109.09234     2.27  0.1448
X1             0.61315      0.15783    724.70295    15.09  0.0007
X2            -0.07224      0.13303     14.15892     0.29  0.5921
X3             0.31172      0.16202    177.73703     3.70  0.0663
X4             0.09795      0.20842     10.60544     0.22  0.6426
X6            -0.21111      0.17328     71.26802     1.48  0.2350

Bounds on condition number: 2.8361, 56.035
------------------------------------------------------------------------------------------------

Forward Selection: Step 6

Variable X5 Entered: R-Square = 0.7326 and C(p) = 7.0000

Forward Selection: Step 6
                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     6     3147.96634      524.66106      10.50    <.0001
Error                    23     1149.00032       49.95654
Corrected Total          29     4296.96667
             Parameter     Standard
Variable      Estimate        Error   Type II SS  F Value  Pr > F
Intercept     10.78708     11.58926     43.28014     0.87  0.3616
X1             0.61319      0.16098    724.80036    14.51  0.0009
X2            -0.07305      0.13572     14.47161     0.29  0.5956
X3             0.32033      0.16852    180.50479     3.61  0.0699
X4             0.08173      0.22148      6.80328     0.14  0.7155
X5             0.03838      0.14700      3.40586     0.07  0.7963
X6            -0.21706      0.17821     74.11004     1.48  0.2356

Bounds on condition number: 3.0782, 76.782
------------------------------------------------------------------------------------------------

All variables have been entered into the model.
                            Summary of Forward Selection

        Variable     Number     Partial      Model
Step    Entered      Vars In    R-Square    R-Square     C(p)      F Value    Pr > F
  1     X1               1       0.6813      0.6813      1.4115      59.86    <.0001
  2     X3               2       0.0267      0.7080      1.1148       2.47    0.1278
  3     X6               3       0.0176      0.7256      1.6027       1.67    0.2082
  4     X2               4       0.0037      0.7293      3.2805       0.35    0.5616
  5     X4               5       0.0025      0.7318      5.0682       0.22    0.6426
  6     X5               6       0.0008      0.7326      7.0000       0.07    0.7963

The equation on the bottom of p. 296.
proc reg data = p054;
  model y = x1 x3 x6;
run;
quit;
The REG Procedure
Model: MODEL1
Dependent Variable: Y

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     3     3117.85753     1039.28584      22.92    <.0001
Error                    26     1179.10914       45.35035
Corrected Total          29     4296.96667

Root MSE              6.73427    R-Square     0.7256
Dependent Mean       64.63333    Adj R-Sq     0.6939
Coeff Var            10.41919
                        Parameter Estimates

                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|
Intercept     1       13.57774        7.54390       1.80      0.0835
X1            1        0.62273        0.11815       5.27      <.0001
X3            1        0.31239        0.15420       2.03      0.0532
X6            1       -0.18695        0.14485      -1.29      0.2082

Table 11.3, p. 297.
proc reg data = p054;
  model y = x1-x6/ selection = backward slstay = 0.01;
run;
quit;
The REG Procedure
Model: MODEL1
Dependent Variable: Y

Backward Elimination: Step 0
All Variables Entered: R-Square = 0.7326 and C(p) = 7.0000
                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     6     3147.96634      524.66106      10.50    <.0001
Error                    23     1149.00032       49.95654
Corrected Total          29     4296.96667
             Parameter     Standard
Variable      Estimate        Error   Type II SS  F Value  Pr > F
Intercept     10.78708     11.58926     43.28014     0.87  0.3616
X1             0.61319      0.16098    724.80036    14.51  0.0009
X2            -0.07305      0.13572     14.47161     0.29  0.5956
X3             0.32033      0.16852    180.50479     3.61  0.0699
X4             0.08173      0.22148      6.80328     0.14  0.7155
X5             0.03838      0.14700      3.40586     0.07  0.7963
X6            -0.21706      0.17821     74.11004     1.48  0.2356

Bounds on condition number: 3.0782, 76.782
------------------------------------------------------------------------------------------------

Backward Elimination: Step 1

Variable X5 Removed: R-Square = 0.7318 and C(p) = 5.0682
                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     5     3144.56048      628.91210      13.10    <.0001
Error                    24     1152.40619       48.01692
Corrected Total          29     4296.96667

             Parameter     Standard
Variable      Estimate        Error   Type II SS  F Value  Pr > F
Intercept     12.79791      8.49061    109.09234     2.27  0.1448
X1             0.61315      0.15783    724.70295    15.09  0.0007
X2            -0.07224      0.13303     14.15892     0.29  0.5921
X3             0.31172      0.16202    177.73703     3.70  0.0663
X4             0.09795      0.20842     10.60544     0.22  0.6426
X6            -0.21111      0.17328     71.26802     1.48  0.2350

Bounds on condition number: 2.8361, 56.035
------------------------------------------------------------------------------------------------

Backward Elimination: Step 2

Variable X4 Removed: R-Square = 0.7293 and C(p) = 3.2805
                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     4     3133.95504      783.48876      16.84    <.0001
Error                    25     1163.01163       46.52047
Corrected Total          29     4296.96667
             Parameter     Standard
Variable      Estimate        Error   Type II SS  F Value  Pr > F
Intercept     14.30347      7.73957    158.88895     3.42  0.0765
X1             0.65338      0.13051   1165.93982    25.06  <.0001
X2            -0.07682      0.13059     16.09751     0.35  0.5616
X3             0.32395      0.15741    197.03481     4.24  0.0502
X6            -0.17151      0.14904     61.60475     1.32  0.2607

Bounds on condition number: 2.1278, 28.27
------------------------------------------------------------------------------------------------

Backward Elimination: Step 3


Variable X2 Removed: R-Square = 0.7256 and C(p) = 1.6027

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     3     3117.85753     1039.28584      22.92    <.0001
Error                    26     1179.10914       45.35035
Corrected Total          29     4296.96667
             Parameter     Standard
Variable      Estimate        Error   Type II SS  F Value  Pr > F
Intercept     13.57774      7.54390    146.90747     3.24  0.0835
X1             0.62273      0.11815   1259.90769    27.78  <.0001
X3             0.31239      0.15420    186.12267     4.10  0.0532
X6            -0.18695      0.14485     75.53983     1.67  0.2082

Bounds on condition number: 2.0946, 15.292
------------------------------------------------------------------------------------------------

Backward Elimination: Step 4

Variable X6 Removed: R-Square = 0.7080 and C(p) = 1.1148
                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     2     3042.31770     1521.15885      32.74    <.0001
Error                    27     1254.64897       46.46848
Corrected Total          29     4296.96667
             Parameter     Standard
Variable      Estimate        Error   Type II SS  F Value  Pr > F
Intercept      9.87088      7.06122     90.80512     1.95  0.1735
X1             0.64352      0.11848   1370.90744    29.50  <.0001
X3             0.21119      0.13440    114.73344     2.47  0.1278

Bounds on condition number: 1.553, 6.2121
------------------------------------------------------------------------------------------------

Backward Elimination: Step 5
Variable X3 Removed: R-Square = 0.6813 and C(p) = 1.4115
                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     1     2927.58425     2927.58425      59.86    <.0001
Error                    28     1369.38241       48.90651
Corrected Total          29     4296.96667
             Parameter     Standard
Variable      Estimate        Error   Type II SS  F Value  Pr > F
Intercept     14.37632      6.61999    230.64710     4.72  0.0385
X1             0.75461      0.09753   2927.58425    59.86  <.0001

Bounds on condition number: 1, 1
------------------------------------------------------------------------------------------------
All variables left in the model are significant at the 0.0100 level.
                          Summary of Backward Elimination

        Variable     Number     Partial      Model
Step    Removed      Vars In    R-Square    R-Square     C(p)      F Value    Pr > F
  1     X5               5       0.0008      0.7318      5.0682       0.07    0.7963
  2     X4               4       0.0025      0.7293      3.2805       0.22    0.6426
  3     X2               3       0.0037      0.7256      1.6027       0.35    0.5616
  4     X6               2       0.0176      0.7080      1.1148       1.67    0.2082
  5     X3               1       0.0267      0.6813      1.4115       2.47    0.1278

In order to get all the information in Table 11.2 and 11.3 from the SAS output remember that the t-value is the square-root of the F-value for that variable and that the RMS is the square-root of the Mean Square Error. 
proc reg data = p054 ;
  model y = x1-x6/ selection = cp;
run;
quit;
The REG Procedure
Model: MODEL1
Dependent Variable: Y

C(p) Selection Method

Number in
  Model          C(p)    R-Square    Variables in Model

       2       1.1148      0.7080    X1 X3
       1       1.4115      0.6813    X1
       3       1.6027      0.7256    X1 X3 X6
       3       2.5136      0.7150    X1 X2 X3
       3       3.0910      0.7083    X1 X3 X4
       3       3.1148      0.7080    X1 X3 X5
       2       3.1892      0.6839    X1 X4
       2       3.2610      0.6831    X1 X2
       4       3.2805      0.7293    X1 X2 X3 X6
       2       3.3284      0.6823    X1 X6
       4       3.3516      0.7285    X1 X3 X4 X6
       2       3.4113      0.6813    X1 X5
       4       3.4590      0.7273    X1 X3 X5 X6
       4       4.4948      0.7152    X1 X2 X3 X4
       4       4.5114      0.7150    X1 X2 X3 X5
       3       4.7049      0.6895    X1 X4 X6
       3       4.9904      0.6862    X1 X2 X4
       5       5.0682      0.7318    X1 X2 X3 X4 X6
       4       5.0862      0.7083    X1 X3 X4 X5
       5       5.1362      0.7310    X1 X2 X3 X5 X6
       3       5.1643      0.6842    X1 X4 X5
       3       5.2246      0.6835    X1 X2 X6
       3       5.2598      0.6831    X1 X2 X5
       5       5.2897      0.7292    X1 X3 X4 X5 X6
       3       5.3204      0.6824    X1 X5 X6
       5       6.4835      0.7154    X1 X2 X3 X4 X5
       4       6.6260      0.6904    X1 X2 X4 X6
       4       6.6924      0.6897    X1 X4 X5 X6
       4       6.9672      0.6865    X1 X2 X4 X5
       6       7.0000      0.7326    X1 X2 X3 X4 X5 X6
       4       7.2175      0.6836    X1 X2 X5 X6
       5       8.6132      0.6906    X1 X2 X4 X5 X6
       3      16.5020      0.5524    X3 X4 X6
       4      17.5748      0.5632    X2 X3 X4 X6
       4      18.4232      0.5533    X3 X4 X5 X6
       5      19.5086      0.5639    X2 X3 X4 X5 X6
       2      23.2501      0.4507    X3 X4
       3      24.5582      0.4587    X2 X3 X4
       3      24.6196      0.4580    X2 X3 X6
       2      24.8228      0.4324    X3 X6
       3      25.0216      0.4533    X3 X5 X6
       4      25.1081      0.4756    X2 X3 X5 X6
       3      25.2305      0.4509    X3 X4 X5
       3      25.9098      0.4430    X2 X4 X6
       4      26.5310      0.4590    X2 X3 X4 X5
       1      26.5568      0.3890    X3
       2      26.9622      0.4075    X2 X3
       2      27.7253      0.3986    X4 X6
       4      27.7426      0.4449    X2 X4 X5 X6
       2      27.9400      0.3961    X3 X5
       3      28.5300      0.4125    X2 X3 X5
       2      29.1996      0.3815    X2 X4
       3      29.4961      0.4013    X4 X5 X6
       1      30.0585      0.3483    X4
       3      30.8168      0.3860    X2 X4 X5
       2      31.6221      0.3533    X4 X5
       1      44.3960      0.1816    X2
       2      45.6241      0.1905    X2 X5
       2      46.3885      0.1817    X2 X6
       3      47.6052      0.1908    X2 X5 X6
       1      57.9091      0.0245    X5
       1      57.9453      0.0241    X6
       2      58.7617      0.0378    X5 X6

Table 11.5, p. 297 (except for the Cp values).
proc reg data = p054 outest = temp;
  model y = x1;
  model y = x1 x4;
  model y = x1 x4 x6;
  model y = x1 x3 x4 x5;
  model y = x1-x5;
  model y = x1-x6;
run;
quit;
The REG Procedure
Model: MODEL1
Dependent Variable: Y

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     1     2927.58425     2927.58425      59.86    <.0001
Error                    28     1369.38241       48.90651
Corrected Total          29     4296.96667

Root MSE              6.99332    R-Square     0.6813
Dependent Mean       64.63333    Adj R-Sq     0.6699
Coeff Var            10.81999
                        Parameter Estimates

                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|
Intercept     1       14.37632        6.61999       2.17      0.0385
X1            1        0.75461        0.09753       7.74      <.0001

The REG Procedure
Model: MODEL2
Dependent Variable: Y

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     2     2938.68666     1469.34333      29.21    <.0001
Error                    27     1358.28001       50.30667
Corrected Total          29     4296.96667

Root MSE              7.09272    R-Square     0.6839
Dependent Mean       64.63333    Adj R-Sq     0.6605
Coeff Var            10.97378

                        Parameter Estimates

                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|
Intercept     1       11.98732        8.42257       1.42      0.1661
X1            1        0.71276        0.13312       5.35      <.0001
X4            1        0.08009        0.17047       0.47      0.6423

The REG Procedure
Model: MODEL3
Dependent Variable: Y

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F

Model                     3     2962.88197      987.62732      19.25    <.0001
Error                    26     1334.08469       51.31095
Corrected Total          29     4296.96667

Root MSE              7.16317    R-Square     0.6895
Dependent Mean       64.63333    Adj R-Sq     0.6537
Coeff Var            11.08277

                        Parameter Estimates

                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|
Intercept     1       12.96654        8.62492       1.50      0.1448
X1            1        0.68765        0.13933       4.94      <.0001
X4            1        0.16545        0.21236       0.78      0.4429
X6            1       -0.11237        0.16365      -0.69      0.4984

The REG Procedure
Model: MODEL4
Dependent Variable: Y

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     4     3043.74506      760.93626      15.18    <.0001
Error                    25     1253.22161       50.12886
Corrected Total          29     4296.96667

Root MSE              7.08017    R-Square     0.7083
Dependent Mean       64.63333    Adj R-Sq     0.6617
Coeff Var            10.95437

                        Parameter Estimates

                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|
Intercept     1        9.98146       11.53149       0.87      0.3949
X1            1        0.65392        0.13920       4.70      <.0001
X3            1        0.22235        0.15451       1.44      0.1625
X4            1       -0.03383        0.20061      -0.17      0.8675
X5            1        0.01009        0.14587       0.07      0.9454

The REG Procedure
Model: MODEL5
Dependent Variable: Y

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     5     3073.85630      614.77126      12.06    <.0001
Error                    24     1223.11037       50.96293
Corrected Total          29     4296.96667

Root MSE              7.13883    R-Square     0.7154
Dependent Mean       64.63333    Adj R-Sq     0.6561
Coeff Var            11.04513

                        Parameter Estimates

                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|
Intercept     1       11.01113       11.70394       0.94      0.3562
X1            1        0.69205        0.14886       4.65      0.0001
X2            1       -0.10356        0.13473      -0.77      0.4496
X3            1        0.24906        0.15962       1.56      0.1318
X4            1       -0.03346        0.20228      -0.17      0.8700
X5            1        0.01549        0.14725       0.11      0.9171

The REG Procedure
Model: MODEL6
Dependent Variable: Y

                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     6     3147.96634      524.66106      10.50    <.0001
Error                    23     1149.00032       49.95654
Corrected Total          29     4296.96667

Root MSE              7.06799    R-Square     0.7326
Dependent Mean       64.63333    Adj R-Sq     0.6628
Coeff Var            10.93552

                        Parameter Estimates

                     Parameter       Standard
Variable     DF       Estimate          Error    t Value    Pr > |t|
Intercept     1       10.78708       11.58926       0.93      0.3616
X1            1        0.61319        0.16098       3.81      0.0009
X2            1       -0.07305        0.13572      -0.54      0.5956
X3            1        0.32033        0.16852       1.90      0.0699
X4            1        0.08173        0.22148       0.37      0.7155
X5            1        0.03838        0.14700       0.26      0.7963
X6            1       -0.21706        0.17821      -1.22      0.2356

The Cp and R-square values in table 11.5, p. 297.
ods listing close;
proc reg data = p054;
  model y = x1-x6/ selection = cp;
  ods output SubsetSelSummary=temp;
run;
quit;
ods listing;
proc print data = temp;
 where varsinmodel = 'X1' or
       varsinmodel = 'X1 X4' OR
       varsinmodel = 'X1 X4 X6' OR 
       varsinmodel = 'X1 X2 X3 X4 X5' OR 
       varsinmodel = 'X1 X2 X3 X4 X5 X6';
 var varsinmodel Cp rsquare ;
run;
Obs    VarsInModel                Cp    RSquare

  2    X1                     1.4115    0.6813
  7    X1 X4                  3.1892    0.6839
 16    X1 X4 X6               4.7049    0.6895
 26    X1 X2 X3 X4 X5         6.4835    0.7154
 30    X1 X2 X3 X4 X5 X6      7.0000    0.7326

Fig. 11.1, p. 298.
symbol1 v=dot c=blue h = .8;
proc reg data = p054  outest = temp covout;
  model y = x1-x6/ selection= rsquare cp noprint;
run;
quit;
data templess (keep = _P_ _CP_ );
  set temp;
  if _CP_ < 10;
run;
 
goptions reset = all;
filename outfile 'chpsasch11_1.gif';
goptions gsfname=outfile dev=gif373; 
axis1 order=(1 to 7 by 1) offset=(3, 5);
symbol1 v=star c=blue h = .8;
proc gplot data = templess;
  plot _CP_*_p_ / haxis = axis1;
run;
quit;

Inputting the Homicide data, table 11.6-11.8, p. 300-301.
data p301;
  input Year FTP UNEMP M LIC GR CLEAR W NMAN G HE WE H ;
cards;
1961 260.35 11.0 455.5 178.15 215.98 93.4 558724 538.1 133.9 2.98 117.18 8.60
1962 269.80 7.0 480.2 156.41 180.48 88.5 538584 547.6 137.6 3.09 134.02 8.90
1963 272.04 5.2 506.1 198.02 209.57 94.4 519171 562.8 143.6 3.23 141.68 8.52
1964 272.96 4.3 535.8 222.10 231.67 92.0 500457 591.0 150.3 3.33 147.98 8.89
1965 272.51 3.5 576.0 301.92 297.65 91.0 482418 626.1 164.3 3.46 159.85 13.07
1966 261.34 3.2 601.7 391.22 367.62 87.4 465029 659.8 179.5 3.60 157.19 14.57
1967 268.89 4.1 577.3 665.56 616.54 88.3 448267 686.2 187.5 3.73 155.29 21.36
1968 295.99 3.9 596.9 1131.21 1029.75 86.1 432109 699.6 195.4 2.91 131.75 28.03
1969 319.87 3.6 613.5 837.80 786.23 79.0 416533 729.9 210.3 4.25 178.74 31.49
1970 341.43 7.1 569.3 794.90 713.77 73.9 401518 757.8 223.8 4.47 178.30 37.39
1971 356.59 8.4 548.8 817.74 750.43 63.4 398046 755.3 227.7 5.04 209.54 46.26
1972 376.69 7.7 563.4 583.17 1027.38 62.5 373095 787.0 230.9 5.47 240.05 47.24
1973 390.19 6.3 609.3 709.59 666.50 58.9 359647 819.8 230.2 5.76 258.05 52.33
;
run;

Creating the standardized variables (11.8), p.300.
proc sql;  
 create table p301 as
 select *, (H - mean(H))/std(H) as zH, (G - mean(G))/std(G) as zG, (M - mean(M))/std(M) as zM,
           (W - mean(W))/std(W) as zW
 from p301;
quit;

Table 11.9, p. 301.
proc reg data = p301;
  model zH = zG zM zW/vif noint;
run;
quit;
The REG Procedure
Model: MODEL1
Dependent Variable: zH
NOTE: No intercept in model. R-Square is redefined
                             Analysis of Variance

                                    Sum of           Mean
Source                   DF        Squares         Square    F Value    Pr > F
Model                     3       11.69500        3.89833     127.82    <.0001
Error                    10        0.30500        0.03050
Uncorrected Total        13       12.00000

Root MSE              0.17464    R-Square     0.9746
Dependent Mean     -1.708E-17    Adj R-Sq     0.9670
Coeff Var         -1.02247E18

                                Parameter Estimates

                     Parameter       Standard                              Variance
Variable     DF       Estimate          Error    t Value    Pr > |t|      Inflation
zG            1        0.23541        0.32763       0.72      0.4889       42.23355
zM            1       -0.40468        0.08585      -4.71      0.0008        2.89965
zW            1       -1.02455        0.35851      -2.86      0.0170       50.56904

Table 11.10, p. 302. The coefficients are in the rows where _type_ = PARMS (parameters) and the t-values are in the rows where _type_ = T.
proc reg data = p301 outest = temp tableout noprint;
  model zH = zG /adjrsq;
  model zH =  zM /adjrsq;
  model zH =  zW/adjrsq;
  model zH = zG zM/adjrsq ;
  model zH = zG zW/adjrsq;
  model zH =  zM zW /adjrsq;
  model zH = zG zM zW /adjrsq;
run;
quit;
proc print data = temp;
 where _type_='PARMS' or _type_ = 'T';
 var _type_  zG zM zW _adjrsq_ ;
run;
Obs    _TYPE_       zG         zM             zW    _ADJRSQ_

  1    PARMS      0.9581      .            .         0.91040
  3    T         11.0875      .            .          .
  7    PARMS       .         0.54642       .         0.23481
  9    T           .         2.16389       .          .
 13    PARMS       .          .          -0.9469     0.88727
 15    T           .          .          -9.7696      .
 19    PARMS      1.1491    -0.26919       .         0.94459
 21    T         11.9125    -2.79057       .          .
 25    PARMS      0.8682      .          -0.0912     0.90173
 27    T          1.6182      .          -0.1700      .
 31    PARMS       .        -0.42995     -1.2759     0.96793
 33    T           .        -5.35378    -15.8879      .
 37    PARMS      0.2354    -0.40468     -1.0246     0.96611
 39    T          0.6817    -4.47205     -2.7112      .

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.