Output from orpol.sas

Source
0 Graphs

NOTE: Capture of log output started.
NOTE: %INCLUDE (level 1) file n:\psy6140\examples\glm\orpol.sas is file
      n:\psy6140\examples\glm\orpol.sas.
74   +title 'Polynomial contrasts';
75   +proc iml;
IML Ready
76   +	
76   + reset print log;
77   +	
78   +	*-- vector of treatment levels;
79   +	
79   + X = {1 2 3 4 };
                X             1 row       4 cols    (numeric)

                           1         2         3         4

80   +	
80   + V = j(4,1) || t(x) || t(x##2) || t(x##3);
                V             4 rows      4 cols    (numeric)

                           1         1         1         1
                           1         2         4         8
                           1         3         9        27
                           1         4        16        64

81   +
82   +	*-- orthogonalize with Gram-Schmidt;	
83   +	
83   + call gsorth(C, T, flag, V);
                C             4 rows      4 cols    (numeric)

                         0.5  -0.67082       0.5 -0.223607
                         0.5 -0.223607      -0.5 0.6708204
                         0.5 0.2236068      -0.5  -0.67082
                         0.5 0.6708204       0.5 0.2236068


                T             4 rows      4 cols    (numeric)

                           2         5        15        50
                           0  2.236068  11.18034 46.510214
                           0         0         2        15
                           0         0         0 1.3416408


                FLAG          1 row       1 col     (numeric)

                                          0

84   +	
85   +	*-- or, generate them directly;
86   +	
86   + C = orpol( X );
                C             4 rows      4 cols    (numeric)

                         0.5  -0.67082       0.5 -0.223607
                         0.5 -0.223607      -0.5 0.6708204
                         0.5 0.2236068      -0.5  -0.67082
                         0.5 0.6708204       0.5 0.2236068

87   +
88   +	*-- 'unnormalize' to get the usual values';
89   +	
89   + C = C * diag( sqrt({4 20 4 20}) );
                C             4 rows      4 cols    (numeric)

                           1        -3         1        -1
                           1        -1        -1         3
                           1         1        -1        -3
                           1         3         1         1

90   +	
91   +	*-- can use unequally-spaced treatment levels;
92   +	
92   + X = {1 2 4 9};
                X             1 row       4 cols    (numeric)

                           1         2         4         9

93   +	
93   + C = orpol( X ) * sqrt(4);
                C             4 rows      4 cols    (numeric)

                           1 -0.973329 1.0864783 -0.933915
                           1 -0.648886 -0.125529 1.6009965
                           1         0 -1.562624 -0.747132
                           1 1.6222142 0.6016752 0.0800498

94   +	
95   +	*-- and/or unequal sample sizes;
96   +	
96   + N = {10 10 20 20};
                N             1 row       4 cols    (numeric)

                          10        10        20        20

97   +	
97   + X = {1 2 4 9};
                X             1 row       4 cols    (numeric)

                           1         2         4         9

98   +	
98   + C = orpol( X, 3, N ) * sqrt(60);
                C             4 rows      4 cols    (numeric)

                           1 -1.224166 1.4469882 -1.186441
                           1 -0.904819 0.2110943 2.0338983
                           1 -0.266123 -1.305357 -0.474576
                           1 1.3306157 0.4763153 0.0508475

99   +	
NOTE: %INCLUDE (level 1) ending.
Exiting IML.