Practice

Computer Programs

SAS headstart
SAS procedures
Program 1
Program 2
Program 3
Program 4
Program 5
Program 6
Program 7
Program 8
Program 9
Program 10
Program 11
Program 12
Program 13
Program 14

Topical Bibliographies (Readings)

Datasets and Stories

Software Help  


Search for 

Program 13

TITLE '1-WAY ANCOVA, Ex 12, Y603';
OPTIONS LS=75 NODATE PAGENO=1;
DATA ANCOVA;
     INPUT TREAT $ X Y;
     LABEL TREAT='methods of teaching Y603'
           X='motivation'
           Y='dependent score';
CARDS;
1 1 1
1 2 1.5
1 4 2
1 3 1.8
2 4.5 2.6
2 2 2
2 3 2.3
2 4 2.5
3 3 4.8
3 2 4
3 4 5.3
3 5 6
;
PROC PRINT;
PROC REG;
     MODEL y=x;
     PLOT y*x;
     BY treat;
TITLE2 'Regression of y on x';
RUN;
PROC GLM;
     CLASS treat;
     MODEL y=x treat/SOLUTION;
     LSMEANS treat/E STDERR PDIFF;
TITLE2 'ANCOVA analysis through TYPE I SS';
RUN;
PROC GLM;
     CLASS treat;
     MODEL y=x treat x*treat;
TITLE2 'test of the equal slope assumption';
RUN;
PROC GLM;
     CLASS treat;
     MODEL y=treat;
TITLE2 'This is an CR-p analysis of the same data';
RUN;
                          1-WAY ANCOVA, Ex 12, Y603                        1
            
                        OBS    TREAT     X      Y
            
                          1      1      1.0    1.0
                          2      1      2.0    1.5
                          3      1      4.0    2.0
                          4      1      3.0    1.8
                          5      2      4.5    2.6
                          6      2      2.0    2.0
                          7      2      3.0    2.3
                          8      2      4.0    2.5
                          9      3      3.0    4.8
                         10      3      2.0    4.0
                         11      3      4.0    5.3
                         12      3      5.0    6.0
 
                        1-WAY ANCOVA, Ex 12, Y603                        2
                           Regression of y on x
            
----------------------- methods of teaching Y603=1 ------------------------
Model: MODEL1
Dependent Variable: Y          dependent score
            
                           Analysis of Variance
            
                           Sum of         Mean
  Source          DF      Squares       Square      F Value       Prob>F
            
  Model            1      0.54450      0.54450       47.348       0.0205
  Error            2      0.02300      0.01150
  C Total          3      0.56750
            
      Root MSE       0.10724     R-square       0.9595
      Dep Mean       1.57500     Adj R-sq       0.9392
      C.V.           6.80877
            
                            Parameter Estimates
            
                    Parameter      Standard    T for H0:
   Variable  DF      Estimate         Error   Parameter=0    Prob > |T|
            
   INTERCEP   1      0.750000    0.13133926         5.710        0.0293
   X          1      0.330000    0.04795832         6.881        0.0205
            
                 Variable
   Variable  DF     Label
            
   INTERCEP   1  Intercept
   X          1  motivation
            
                          1-WAY ANCOVA, Ex 12, Y603                        3
                           Regression of y on x
            
----------------------- methods of teaching Y603=1 ------------------------
            
      |---|----|----|----|----|----|----|----|----|----|----|----|----|----|
    Y |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
  2.0 +                                                               1    +
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
  1.8 +                                           1                        +
d     |                                                                    |
e     |                                                                    |
p     |                                                                    |
e     |                                                                    |
n     |                                                                    |
d 1.6 +                                                                    +
e     |                                                                    |
n     |                                                                    |
t     |                       1                                            |
      |                                                                    |
s     |                                                                    |
c 1.4 +                                                                    +
o     |                                                                    |
r     |                                                                    |
e     |                                                                    |
      |                                                                    |
      |                                                                    |
  1.2 +                                                                    +
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
  1.0 +   1                                                                +
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |---|----|----|----|----|----|----|----|----|----|----|----|----|----|
        1.00 1.25 1.50 1.75 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00
            
                                 motivation   X
                          1-WAY ANCOVA, Ex 12, Y603                        4
                           Regression of y on x
            
----------------------- methods of teaching Y603=2 ------------------------
            
Model: MODEL1
Dependent Variable: Y          dependent score
            
                           Analysis of Variance
            
                           Sum of         Mean
  Source          DF      Squares       Square      F Value       Prob>F
            
  Model            1      0.20763      0.20763      175.000       0.0057
  Error            2      0.00237      0.00119
  C Total          3      0.21000
            
      Root MSE       0.03444     R-square       0.9887
      Dep Mean       2.35000     Adj R-sq       0.9831
      C.V.           1.46573
            
                            Parameter Estimates
            
                    Parameter      Standard    T for H0:
   Variable  DF      Estimate         Error   Parameter=0    Prob > |T|
            
   INTERCEP   1      1.549153    0.06294049        24.613        0.0016
   X          1      0.237288    0.01793730        13.229        0.0057
            
                 Variable
   Variable  DF     Label
            
   INTERCEP   1  Intercept
   X          1  motivation
            
                          1-WAY ANCOVA, Ex 12, Y603                        5
                           Regression of y on x
            
----------------------- methods of teaching Y603=2 ------------------------
            
      |---|----|----|----|----|----|----|----|----|----|----|----|----|----|
    Y |                                                                    |
      |                                                                    |
      |                                                                    |
  2.6 +                                                               1    +
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
  2.5 +                                                  1                 +
      |                                                                    |
      |                                                                    |
      |                                                                    |
d     |                                                                    |
e     |                                                                    |
p 2.4 +                                                                    +
e     |                                                                    |
n     |                                                                    |
d     |                                                                    |
e     |                                                                    |
n     |                                                                    |
t 2.3 +                         1                                          +
      |                                                                    |
s     |                                                                    |
c     |                                                                    |
o     |                                                                    |
r     |                                                                    |
e 2.2 +                                                                    +
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
  2.1 +                                                                    +
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
      |                                                                    |
  2.0 +1                                                                   +
      |                                                                    |
      |                                                                    |
      |---|----|----|----|----|----|----|----|----|----|----|----|----|----|
      2.0  2.2  2.4  2.6  2.8  3.0  3.2  3.4  3.6  3.8  4.0  4.2  4.4  4.6
            
                                 motivation   X
                          1-WAY ANCOVA, Ex 12, Y603                        6
                           Regression of y on x
            
----------------------- methods of teaching Y603=3 ------------------------
            
Model: MODEL1
Dependent Variable: Y          dependent score
            
                           Analysis of Variance
            
                           Sum of         Mean
  Source          DF      Squares       Square      F Value       Prob>F
            
  Model            1      2.11250      2.11250      281.667       0.0035
  Error            2      0.01500      0.00750
  C Total          3      2.12750
            
      Root MSE       0.08660     R-square       0.9929
      Dep Mean       5.02500     Adj R-sq       0.9894
      C.V.           1.72343
            
                            Parameter Estimates
            
                    Parameter      Standard    T for H0:
   Variable  DF      Estimate         Error   Parameter=0    Prob > |T|
            
   INTERCEP   1      2.750000    0.14230249        19.325        0.0027
   X          1      0.650000    0.03872983        16.783        0.0035
            
                 Variable
   Variable  DF     Label
            
   INTERCEP   1  Intercept
   X          1  motivation
            
                          1-WAY ANCOVA, Ex 12, Y603                        7
                           Regression of y on x
            
----------------------- methods of teaching Y603=3 ------------------------
            
       |---|----|----|----|----|----|----|----|----|----|----|----|----|----|
     Y |                                                                    |
  6.00 +                                                              1     +
       |                                                                    |
       |                                                                    |
       |                                                                    |
       |                                                                    |
  5.75 +                                                                    +
       |                                                                    |
       |                                                                    |
       |                                                                    |
       |                                                                    |
  5.50 +                                                                    +
       |                                                                    |
d      |                                                                    |
e      |                                                                    |
p      |                                          1                         |
e 5.25 +                                                                    +
n      |                                                                    |
d      |                                                                    |
e      |                                                                    |
n      |                                                                    |
t 5.00 +                                                                    +
       |                                                                    |
s      |                                                                    |
c      |                                                                    |
o      |                      1                                             |
r 4.75 +                                                                    +
e      |                                                                    |
       |                                                                    |
       |                                                                    |
       |                                                                    |
  4.50 +                                                                    +
       |                                                                    |
       |                                                                    |
       |                                                                    |
       |                                                                    |
  4.25 +                                                                    +
       |                                                                    |
       |                                                                    |
       |                                                                    |
       |                                                                    |
  4.00 +  1                                                                 +
       |---|----|----|----|----|----|----|----|----|----|----|----|----|----|
         2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00
            
                                  motivation   X
                          1-WAY ANCOVA, Ex 12, Y603                        8
                     ANCOVA analysis through TYPE I SS
            
                      General Linear Models Procedure
                          Class Level Information
            
                         Class    Levels    Values
            
                         TREAT         3    1 2 3
            
                  Number of observations in data set = 12
            
                         1-WAY ANCOVA, Ex 12, Y603                        9
                     ANCOVA analysis through TYPE I SS
            
Dependent Variable: Y   dependent score
                                   Sum of          Mean
Source                  DF        Squares        Square  F Value    Pr > F
            
Model                    3     28.6482420     9.5494140   163.09    0.0001
            
Error                    8      0.4684247     0.0585531
            
Corrected Total         11     29.1166667
            
                  R-Square           C.V.      Root MSE             Y Mean
            
                  0.983912       8.110976       0.24198            2.98333
            
Source                  DF      Type I SS   Mean Square  F Value    Pr > F
            
X                        1      8.5587938     8.5587938   146.17    0.0001
TREAT                    2     20.0894482    10.0447241   171.55    0.0001
            
Source                  DF    Type III SS   Mean Square  F Value    Pr > F
            
X                        1      2.4365753     2.4365753    41.61    0.0002
TREAT                    2     20.0894482    10.0447241   171.55    0.0001
            
                                 T for H0:     Pr > |T|    Std Error of
Parameter          Estimate     Parameter=0                  Estimate
            
INTERCEPT       3.548287671 B         13.70      0.0001      0.25892459
X               0.421917808            6.45      0.0002      0.06540528
TREAT     1    -3.028082192 B        -16.53      0.0001      0.18317858
          2    -2.622260274 B        -15.31      0.0001      0.17129910
          3     0.000000000 B           .         .           .
            
NOTE: The X'X matrix has been found to be singular and a generalized
      inverse was used to solve the normal equations.   Estimates followed
      by the letter 'B' are biased, and are not unique estimators of the
      parameters.
            
            
            
                          1-WAY ANCOVA, Ex 12, Y603                       10
                     ANCOVA analysis through TYPE I SS
            
			Coefficients for TREAT Least Square Means
            
            
TREAT                                 1             2             3
            
Effect                     Coefficients
            
INTERCEPT                             1             1             1
            
X                                 3.125         3.125         3.125
            
TREAT     1                           1             0             0
          2                           0             1             0
          3                           0             0             1
            
                         1-WAY ANCOVA, Ex 12, Y603                       11
                     ANCOVA analysis through TYPE I SS
            
          TREAT             Y       Std Err     Pr > |T|   LSMEAN
                       LSMEAN        LSMEAN   H0:LSMEAN=0   Number
            
          1        1.83869863    0.12770789        0.0001     1
          2        2.24452055    0.12208864        0.0001     2
          3        4.86678082    0.12344976        0.0001     3
            
                     Pr > |T| H0: LSMEAN(i)=LSMEAN(j)
            
                          i/j     1       2       3
                          1   .      0.0546  0.0001
                          2  0.0546   .      0.0001
                          3  0.0001  0.0001   .
            
NOTE: To ensure overall protection level, only probabilities associated
      with pre-planned comparisons should be used.
            
                         1-WAY ANCOVA, Ex 12, Y603                       12
                    test of the equal slope assumption
            
			  Class    Levels    Values
            
                         TREAT         3    1 2 3
            
                  Number of observations in data set = 12
            
                         1-WAY ANCOVA, Ex 12, Y603                       13
                    test of the equal slope assumption
            
Dependent Variable: Y   dependent score
                                   Sum of          Mean
Source                  DF        Squares        Square  F Value    Pr > F
            
Model                    5     29.0762938     5.8152588   864.23    0.0001
            
Error                    6      0.0403729     0.0067288
Corrected Total         11     29.1166667
            
                  R-Square           C.V.      Root MSE             Y Mean
            
                  0.998613       2.749587       0.08203            2.98333
            
Source                  DF      Type I SS   Mean Square  F Value    Pr > F
            
X                        1      8.5587938     8.5587938  1271.96    0.0001
TREAT                    2     20.0894482    10.0447241  1492.79    0.0001
X*TREAT                  2      0.4280518     0.2140259    31.81    0.0006
            
Source                  DF    Type III SS   Mean Square  F Value    Pr > F
            
X                        1     2.20771803    2.20771803   328.10    0.0001
TREAT                    2     0.95405465    0.47702733    70.89    0.0001
X*TREAT                  2     0.42805178    0.21402589    31.81    0.0006
            
                         1-WAY ANCOVA, Ex 12, Y603                       14
                 This is an CR-p analysis of the same data
                         
                         Class    Levels    Values
                         TREAT         3    1 2 3
            
                  Number of observations in data set = 12
            
                         1-WAY ANCOVA, Ex 12, Y603                       15
                 This is an CR-p analysis of the same data
            
Dependent Variable: Y   dependent score
                                   Sum of          Mean
Source                  DF        Squares        Square  F Value    Pr > F
            
Model                    2     26.2116667    13.1058333    40.60    0.0001
            
Error                    9      2.9050000     0.3227778
            
Corrected Total         11     29.1166667
            
                  R-Square           C.V.      Root MSE             Y Mean
            
                  0.900229       19.04364       0.56814            2.98333
            
            
Source                  DF      Type I SS   Mean Square  F Value    Pr > F
            
TREAT                    2     26.2116667    13.1058333    40.60    0.0001
            
Source                  DF    Type III SS   Mean Square  F Value    Pr > F
            
TREAT                    2     26.2116667    13.1058333    40.60    0.0001
            



Comments: peng@indiana.edu
Dr. Peng's Home Page: Dr. Chao-Ying Joanne Peng
Copyright 1999, The Trustees of Indiana University