9
Analysis of Covariance
9.1 Introduction
9.2 Models
9.3 Least Squares Estimates
9.4 Analysis of Covariance
9.5 Treatment Contrasts and Condence Intervals
9.6 Using SAS Software
Exercises
9.1
Introduction
In Chapters 37, we used completely randomized desi
9.3
281
Least Squares Estimates
9.3.2
Least Squares Estimates and Adjusted Treatment Means
Under model (9.2.2) the expected value
+ i + (x i. x . )
E[Y i. ]
is an estimate of the mean response of the ith treatment when the value of the covariate xit
is x
280
Chapter 9
Analysis of Covariance
If there is more than one covariate, the single covariate term can be replaced by an
appropriate polynomial function of all the covariates. For example, for two covariates x1
and x2 , the secondorder function
2
2
1 x1
278
Chapter 9
Analysis of Covariance
possibility is to use a completely randomized design with response being the weight gain
over the experimental period. This loses information, however, since heavier piglets may
experience higher weight gain than light
274
Exercises
(d) Calculate a 95% condence interval for the mean crank rate needed to maintain a
speed of 18 mph in twelfth gear on level ground.
(e) Find the 95% condence band for the regression line. Draw a scatter plot of the
data and superimpose the r
276
Exercises
(d) Using the data of Table 8.1 and a statistical computing package, t a quadratic
model to the original values. Test the hypotheses
L
H0 : cfw_2
0
and
H0 : cfw_1
2
0
against their respective twosided alternative hypotheses. Compare the res
273
Exercises
software is as follows. In line 4 of the program, add a classication variable A, using the
statement A=X;. Then insert a PROC GLM procedure before PROC REG as follows.
PROC GLM;
CLASS A;
MODEL LENGTH = X X2 A;
Then the Type I sum of squares
9.4
283
Analysis of Covariance
and
ri
v
ssxx
i 1 t 1
(xit x . )2 .
So,
2
t
yit (xit x . )
t
yit y . spxy (xit x . )/ssxx
ssE 0
i
i
(9.4.9)
2
ssyy (spxy )2 /ssxx ,
2
where ssyy
i
t (yit y . ) . The number of degrees of freedom for error is equal to the
num
284
Chapter 9
Table 9.2
Analysis of Covariance
Analysis of covariance for one linear covariate
Source of
Variation
Degrees of
Freedom
Mean
Square
Ratio
v 1
ss(T )
ss(T )
v 1
ms(T )
msE
ms(T )
msE
nv 1
n1
T 
Sum of
Squares
ssE
ss yy
1
T
Error
Total
292
Exercises
Exercises
1. Consider the hypothetical data of Example 9.3.2, in which two treatments are to be
compared.
(a) Fit the analysis of covariance model (9.2.1) or (9.2.2) to the data of Table 9.1, page
282.
(b) Plot the residuals against the cova
9.6
291
Using SAS Software
The SAS System
Plot of Z*RUNORDER.
Legend: A = 1 obs, B = 2 obs, etc.
2 +
AA

A
A
Z 
A

A
A
A
A

A
A
A
0 +AAAAAAA
AAA
A

A
A
A

A
A A

A
A
A
2 +
+++++0
10
20
30
40
Figure 9.4
SAS plot of zit against
run ord
290
Chapter 9
Table 9.6
Analysis of Covariance
Output from SAS PROC GLM
The SAS System
General Linear Models Procedure
Class Level Information
Class
Levels
Values
COLOR
4
1 2 3 4
Number of observations in data set = 32
Dependent Variable: INFTIME
DF
4
27
286
Chapter 9
Analysis of Covariance
Of secondary interest is the test of H0 : cfw_ 0 against HA : cfw_ 0. The decision rule is
to reject the null hypothesis if ms(T )/msE 17.95 > F1,27, . Again, the null hypothesis
is rejected at signicance level 0.01,
9.5
287
Treatment Contrasts and Condence Intervals
9.5.2
Multiple Comparisons
The multiple comparison methods of Bonferroni and Scheff are applicable in the analysis
e
of covariance setting. However, since the adjusted treatment means + i Y i. (x i. x . )
9.4
285
Analysis of Covariance
zit
T
3
2
1
0
b
bb b
b
1
b
b
b
b
b
bb
b
b
b
2
b
b
b
bb
b b bb
b bb
3
b b
b
b
b
Figure 9.3
E
Residual plot for the
balloon experiment
5
10
15
20
25
Thus, the decision rule for testing H0 : cfw_
, is
30
Run order
0 against
8.9
271
Using SAS Software
ssE 0 ssE1 , where ssE 0 is the error sum of squares for the model with E[Yxt ] 0 , and
ssE 1 is the error sum of squares for the simple linear regression model E[Yxt ] 0 + 1 x;
that is,
ss(1 0 )
ssE 0 ssE 1
1891.776471 .
Likew
270
Chapter 8
Table 8.10
Polynomial Regression
Output generated by PROC REG
The SAS System
Model: MODEL1
Dependent Variable: LENGTH
Analysis of Variance
Source
Model
Error
C Total
DF
3
64
67
Root MSE
Dep Mean
C.V.
Sum of
Squares
2501.29412
702.82353
3204.
8.7
259
Orthogonal Polynomials and Trend Contrasts (Optional)
When there are r observations on each of the v quantitative levels x of the treatment factor,
r x x/n
x x .
the average value of x is x .
x x/v. The transformation zx
centers the levels x at ze
256
Chapter 8
Table 8.4
Polynomial Regression
Analysis of variance table for polynomial regression model of degree p.
Here ssE b denotes the error sum of squares obtained by tting the
polynomial regression model of degree b.
Source of
Variation
p
Degrees
258
Chapter 8
Polynomial Regression
standard computer output. If the model assumptions are satised, then
j j
Var(j )
tnp1 .
Individual condence intervals can be obtained for the model parameters, as we illustrated
in Section 8.5 for the simple linear reg
8.6
Table 8.5
257
Analysis of Polynomial Regression Models
Analysis of variance for the quadratic model
Source of
Variation
2
Model
Error
Total
yxt
Degrees of
Freedom
1
2
12
14
b
. .b . . . . .b . .
b
b
.
. b
b
.b .
.b
.b
Sum of
Squares
3326.2860
6278.676
8.6
255
Analysis of Polynomial Regression Models
onesided version of the decision rule (8.5.10) and calculate
1 0
msE
1
ssxx
0.02396
0.00020466
117.07 ,
slp
and since this is considerably greater than t18,0.01
2.552, we reject H0 . We therefore
conclude
8.5
253
Analysis of the Simple Linear Regression Model
The variance associated with this estimator is
Var(Yxa )
2
1 (xa x . )2
+
n
ssxx
.
Since Yxa is a linear combination of the normally distributed random variables 0 and 1 , it,
2
too, has a normal dist
Help needed for statistical analysis
edm
December 20, 2016
R Markdown
Chapter 1
Question 1.
a
Percent of MCC students full time
F ul lT im e S t a t u s
T o t a l N u mb e r
,
3537
9205
which is 38
percent
b
Percent of MCC students part time 10038 = 62 p