Docstoc

clx2 multiple regression SAS output

Document Sample
clx2 multiple regression SAS output Powered By Docstoc
					                         clx2: Multiple regression example
                                Stat 404; Fall 2011

The following program was used to generate our second class example. The original
program is saved on the class website under examples as “clx2.” In addition to the
program, this handout contains the summary statistics as provided by “proc corr,”
and the multiple regression program, as specified by the proc statement in the SAS
program.


The SAS program

   Data Clx2;
     input y x1 x2;
     X0=1;
   Cards;
   2 1 7
   5 2 5
   4 3 6
   6 4 3
   8 5 4
   run;
   proc print; var y x0 x1 x2; run;
   proc means; var y x1 x2; run;
   proc corr; var y x1 x2; run;
   proc reg; model y=x1; run;
   proc reg; model y=x2; run;
   proc reg; model y=x1 x2/p r xpx i;
     output out=out1 p=p1 r=r1; run;
     proc plot; plot r1*p1; run;



The CORR Procedure

                                          Simple Statistics

   Variable          N        Mean      Std Dev        Sum       Minimum      Maximum

   y                 5    5.00000       2.23607      25.00000    2.00000      8.00000
   x1                5    3.00000       1.58114      15.00000    1.00000      5.00000
   x2                5    5.00000       1.58114      25.00000    3.00000      7.00000


                               Pearson Correlation Coefficients, N = 5
                                      Prob > |r| under H0: Rho=0

                                            y            x1              x2

                          y           1.00000       0.91924      -0.84853
                                                     0.0272        0.0691

                          x1          0.91924       1.00000      -0.80000
                                       0.0272                      0.1041

                          x2         -0.84853      -0.80000       1.00000
                                       0.0691        0.1041
The REG Procedure

The sums of squares & cross-products

                                                   Model: MODEL1

                                          Model Crossproducts X'X X'Y Y'Y

       Variable      Intercept                       x1                  x2                   y

       Intercept             5                       15               25                     25
       x1                   15                       55               67                     88
       x2                   25                       67              135                    113
       y                    25                       88              113                    145


The inverse matrix, with parameter estimates on the right and in the last row, and
with the sums of squares due to error in the lower right corner:


                                 X'X Inverse, Parameter Estimates, and SSE

       Variable          Intercept                 x1               x2                  y

       Intercept    16.311111111              -1.944444444      -2.055555556            4.3888888889
       x1           -1.944444444               0.2777777778      0.2222222222           0.9444444444
       x2           -2.055555556               0.2222222222      0.2777777778           0.444444444
       y             4.3888888889              0.9444444444      -0.444444444           2.3888888889


The resulting prediction equation with associated t-tests:


                                                Parameter Estimates

                                             Parameter         Standard
              Variable        DF              Estimate            Error       t Value        Pr > |t|

              Intercept          1             4.38889         4.41392           0.99             0.4248
              x1                 1             0.94444         0.57601           1.64             0.2428
              x2                 1            -0.44444         0.57601          -0.77             0.5211


And the resulting ANOVA table with associated F-test:

                                                Analysis of Variance

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

         Model                        2         17.61111           8.80556         7.37           0.1194
         Error                        2          2.38889           1.19444
         Corrected Total              4         20.00000


                         Root MSE                    1.09291       R-Square        0.8806
                         Dependent Mean              5.00000       Adj R-Sq        0.7611
                         Coeff Var                  21.85813

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:8
posted:12/19/2011
language:English
pages:2