Orthogonal Plynomials in SAS

Synthetic Fiber Example

Program Listing

DATA fiber;
 INPUT strength cotton  @@;
 DATALINES;
 7 15   7 15  15 15  11 15   9 15  12 20  17 20  12 20
18 20  18 20  14 25  18 25  18 25  19 25  19 25  19 30
25 30  22 30  19 30  23 30   7 35  10 35  11 35  15 35
11 35
;

OPTIONS LS=80 NODATE NONUMBER;

TITLE1 'Orthogonal Polynomials in SAS';
PROC GLM DATA=fiber;
 CLASS cotton;
 TITLE2 'One-Way Model';
 MODEL strength = cotton;
 RUN;
 TITLE2 'Components of the Orthogonal Polynomial Contrasts';
 CONTRAST 'Linear'    cotton -2 -1  0  1  2;
 CONTRAST 'Quadratic' cotton  2 -1 -2 -1  2;
 CONTRAST 'Cubic'     cotton -1  2  0 -2  1;
 CONTRAST 'Quartic'   cotton  1 -4  6 -4  1;
 RUN;
 TITLE2 'Estimates of the Orthogonal Polynomial Contrasts';
 ESTIMATE 'Linear'    cotton -2 -1  0  1  2 / DIVISOR = 10;
 ESTIMATE 'Quadratic' cotton  2 -1 -2 -1  2 / DIVISOR = 14;
 ESTIMATE 'Cubic'     cotton -1  2  0 -2  1 / DIVISOR = 10;
 ESTIMATE 'Quartic'   cotton  1 -4  6 -4  1 / DIVISOR = 70;
 * The DIVISOR in each case above is the respective Li;
 RUN;
QUIT;

Output Listing

                         Orthogonal Polynomials in SAS
                                 One-Way Model

                               The GLM Procedure

Dependent Variable: strength

                                                                      
                              Sum of
 Source             DF       Squares    Mean Square   F Value   Pr > F
 Model               4   475.7600000    118.9400000     14.76   <.0001
 Error              20   161.2000000      8.0600000                   
 Corrected Total    24   636.9600000                                  


             R-Square     Coeff Var      Root MSE    strength Mean
             0.746923      18.87642      2.839014         15.04000


 Source         DF      Type I SS    Mean Square   F Value   Pr > F
 cotton          4    475.7600000    118.9400000     14.76   <.0001


 Source         DF    Type III SS    Mean Square   F Value   Pr > F
 cotton          4    475.7600000    118.9400000     14.76   <.0001


                         Orthogonal Polynomials in SAS
               Components of the Orthogonal Polynomial Contrasts

                               The GLM Procedure

Dependent Variable: strength

                                                                 
 Contrast     DF    Contrast SS    Mean Square   F Value   Pr > F
 Linear        1     33.6200000     33.6200000      4.17   0.0545
 Quadratic     1    343.2142857    343.2142857     42.58   <.0001
 Cubic         1     64.9800000     64.9800000      8.06   0.0101
 Quartic       1     33.9457143     33.9457143      4.21   0.0535
                       Components



                         Orthogonal Polynomials in SAS
                Estimates of the Orthogonal Polynomial Contrasts

                               The GLM Procedure

Dependent Variable: strength

                                                               
                                Standard
  Parameter       Estimate         Error    t Value    Pr > |t|
  Linear        0.82000000    0.40149720       2.04      0.0545
  Quadratic    -2.21428571    0.33932707      -6.53      <.0001
  Cubic        -1.14000000    0.40149720      -2.84      0.0101
  Quartic      -0.31142857    0.15175168      -2.05      0.0535

  Note: The estimates above are coefficients for the orthogonal
        polynomial models. That is, each one is the estimate of
        the contrast divided by the divisor (psi.hat / Li).
        Hence, if a 3rd order polynomial model is desired,
        then it's
        y.hat = 15.04 + 0.820 P1(x)
                      - 2.214 P2(x)
                      - 1.140 P3(x)
        where the constant 15.04 is the grand mean (not given above,
        however a LSMEAN statement or a MEAN statement allows you
        to obtain treatment means and hence grand mean).