4.9. INTERACTION MODEL. Sample SAS Program. Sample SAS Output

Document Sample
4.9. INTERACTION MODEL. Sample SAS Program. Sample SAS Output Powered By Docstoc
					STAT 410/510 Thursday, October 8, 2009

                              4.9. INTERACTION MODEL.

                                   Sample SAS Program.
title'Interaction Model';
/*Amount of body fat (fat) is regressed on triceps skinfold
thickness (triceps), thigh circumference (thigh), and midarm
circumference (midarm). An interaction model is tested.*/
data body_fat;
input triceps thigh midarm fat @@;
datalines;
19.5 43.1 29.1 11.9 24.7 49.8 28.2 22.8
30.7 51.9 37.0 18.7 29.8 54.3 31.1 20.1
19.1 42.2 30.9 12.9 25.6 53.9 23.7 21.7
31.4 58.5 27.6 27.1 27.9 52.1 30.6 25.4
22.1 49.9 23.2 21.3 25.5 53.5 24.8 19.3
31.1 56.6 30.0 25.4 30.4 56.7 28.3 27.2
18.7 46.5 23.0 11.7 19.7 44.2 28.6 17.8
14.6 42.7 21.3 12.8 29.5 54.4 30.1 23.9
27.7 55.3 25.7 22.6 30.2 58.6 24.6 25.4
22.7 48.2 27.1 14.8 25.2 51.0 27.5 21.1
;

proc glm;
 model fat=triceps thigh midarm triceps*thigh triceps*midarm
 thigh*midarm triceps*thigh*midarm;
/* or model fat=triceps|thigh|midrarm */
 run;

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

                                   Sample SAS Output.

                        R-Square         Coeff Var    Root MSE      fat Mean

                        0.946202         16.12040     2.888775      17.92000



                                                         Standard
          Parameter                        Estimate         Error     t Value   Pr > |t|

          Intercept                  -290.1679697     586.2236893       -0.49    0.6696
          triceps                      12.7810168      24.1011456        0.53    0.6489
          thigh                         7.5147941      13.3873981        0.56    0.6311
          midarm                       17.7106041      23.3637895        0.76    0.5276
          triceps*thigh                -0.2291072       0.4936951       -0.46    0.6882
          triceps*midarm               -0.4278254       0.8986733       -0.48    0.6810
          thigh*midarm                 -0.5121263       0.5626171       -0.91    0.4588
          triceps*thigh*midarm          0.0119740       0.0194029        0.62    0.6000




                                                 1
                  4.10. QUADRATIC REGRESSION MODEL.

                           Sample SAS Program.
title'Quadratic Regression Model';
/* A car is tested for gas mileage at various speeds (mph) to determine
at what speed the car achieves the greatest gas mileage (mpg). */
data mileage;
input mph mpg @@;
datalines;
35 22 35 20 40 28 40 31 45 37 45 38
50 41 50 39 55 34 55 37 60 27 60 30
;

proc gplot;
  plot mpg*mph;
  run;

  proc glm;
  model mpg=mph mph*mph;
  run;

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

                           Sample SAS Output.




                                    2
                     The GLM Procedure



       R-Square      Coeff Var        Root MSE     mpg Mean

       0.947388       5.395807        1.726658     32.00000



                                          Standard
Parameter         Estimate             Error    t Value   Pr > |t|

Intercept    -182.5821429        17.67702859     -10.33       <.0001
mph             8.9832143         0.76156346      11.80       <.0001
mph*mph        -0.0910714         0.00799288     -11.39       <.0001




                             3