Final_ExamST512_AUG052011_SolutionAUG092011.pdf

NCSU ST512
1.
Final Exam
Sum 2 2011
Let Gi denote the weight gain for the firstborn male piglet in litter i over a given
period of time and let Pi denote the number of other piglets (siblings) in the same litter. I
observed n litters of pigs and fit a least squares line relating first born male weight gain G
to number of siblings P so my model was Gi  0  1Pi  ei . The estimated model came
out to Gˆ  80  0.5P . My n 2 X matrix had a column of 1s and a column of Pi values as
i
i
usual. I obtained
 50 110 
XX  

110 260
 XX 
1

1  260 110
900  110 50 
Answer these if possible from this information (if not possible, put NP)
(a) How many observations (litters) did I have in my experiment? n = 50
(b) Compute, if possible, the sum of the n weight gains in this experiment
n
G
i 1
i
 3945
Gˆ i  80  0.5Pi
 o  y  1 x
Note that the regression line passes through the
 x, y 
point, and
y   o  1 x
 110  3945
y  80   0.5 

50
 50 
 110 
80  y   0.5  

 50 
3945
 110 
y  80   0.5  
  80  1.1  78.9 
50
 50 
(d) We have seen that the estimated intercept b 0 and slope b1 together form a random vector
that varies from sample to sample with variance-covariance matrix  XX   2 . Assuming
1
 2 is known to be 90, compute the covariance between b 0 and b1 , as well as the variance of
W , where W  2b0  3b1 .
  
1  260 110 
1
Var   o     2  XX   90 
  
900  110 50 
 1 
   2
W  2 o  3 1   2 3  o   
   3
 1


Cov  o ,  1  90 
1
  110   11.0
900
 90  260 110    2 
1  2 
V ar(W )   2 3  2   XX       2 3 

     17

  3
 900  110 50    3 
1
If a theory doesn’t square with experiment, it’s wrong. Richard Feynman’s talk The key to Science:
http://www.openculture.com/2011/04/richard_feynman_talks_science_and_bill_gates_posts_talks_online.html
August 4, 20111
NCSU ST512
Final Exam
Sum 2 2011
2. I have data on yield using three fertilizers A, B, and C and want to run a
multiple regression that will regress a column Y on a matrix X. My data
are shown below.
I am especially interested in comparing fertilizer A to the averaqe of B
and C. Find a second comparison orthogonal to this comparison.
Y
FERTILIZER
C1
C2
10
A
-2
0
18
A
-2
0
22
A
-2
0
14
A
-2
0
22
B
1
-1
28
B
1
-1
32
B
1
-1
26
B
1
-1
25
C
1
1
33
C
1
1
30
C
1
1
28
C
1
1
I run the analysis of variance for this data, Anova table is presented below.
a) Fill the blanks in the table below
Source
DF
Sum of Squares
Mean Square
F Value
Pr > F
Fertilizer
2
392.0000000
196.0000000
10.63
0.0043
Error
9
166.0000000
18.4444444
11
558.0000000
A
B
Corrected Total
Fertilizer
y LSMEAN
2
C
Q
divisor
SS(Q)
=Q^2/divisor
16.0
27.0
29
Total
64
108
116
C1
-2
1
1
96
6*4=24
384
C2
0
-1
1
8
4*2=8
8
If a theory doesn’t square with experiment, it’s wrong. Richard Feynman’s talk The key to Science:
http://www.openculture.com/2011/04/richard_feynman_talks_science_and_bill_gates_posts_talks_online.html
August 4, 20111
NCSU ST512
Final Exam
Sum 2 2011
b) Compute the SS for contrasts C1 (Fertilizer A versus B and C) and C2 (your selected contrast).
C1   c1i y i   2  y1  1 y 2  1 y 3   2  16  1  27  1  29  24
i


6
2
2
2 
1
var C1  MSE   2   1  1   18.4444   27.6666
4
4

24  0
24
tC1 

 4.56
FC1  tC21  4.562  20.81933
27.6666 5.259905
 
 
MS C1  MSE  FC1  18.4444  20.81933  384
C2   c2i y i   0  y1   1 y 2  1 y 3   0  16   1  27  1  29  2
i


2
2
2
2 
1
var C2  MSE   0    1  1   18.4444   9.2222
4
4

20
2
tC2 

 0.6586
FC2  tC22  2.632  0.4337
9.2222 3.04
 
 
MS C2  MSE  FC2  18.4444  0.4337  8
c) Write down and test the hypothesis corresponding to each contrast. Use a=0.05. Conclusions.
F1,9,0.05  5.12
t9,0.05 2  2.26
H o : C1  0
Ho :
 B  C
 A  0
2
  C
H1 : B
  A  0,
2
H1 : C1  0,
tC1  4.56
Reject Ho .
Ĉ1 is significantly
Reject Ho .
Ĉ2 is
different from 0, at a significance level of 0.05
H o : C2  0
H o : C   B  0
H1 : C2  0,
H1 : C   B  0,
tC1  0.6586
significantly different from 0, at a significance level of 0.05
d) I decided to run a regression analysis for Y on C1 and C2. Fill blanks in the following table of
analysis of variance for regression.
Parameter Estimates
Variable
3
Parameter Standard
DF
Estimate
Error t Value Pr > |t|
Type I SS
Type II SS
Intercept
1
24.00000
1.23977
19.36 <.0001 6912.00000 6912.00000
C1
1
****
****
4.56 0.0014
384.00000
384.00000
C2
1
****
****
0.66 0.5266
8.00000
8.00000
If a theory doesn’t square with experiment, it’s wrong. Richard Feynman’s talk The key to Science:
http://www.openculture.com/2011/04/richard_feynman_talks_science_and_bill_gates_posts_talks_online.html
August 4, 20111
NCSU ST512
Final Exam
Sum 2 2011
3. Three tissue samples are taken from each of six randomly selected mice. The percentage of surface
area covered with epithelial cells is as follows:
Analysis Variable : y %surface area covered with epithelial cells
mouse
Samples
Mean
Corrected SS
Variance
Mouse 1
23.9, 19.7, 19.5
21.03
12.3467
6.1733
Mouse 2
25.4, 30.4, 23.9
26.57
23.1667
11.5833
Mouse 3
16.2, 20.7, 22.7
19.87
22.1667
11.0833
Mouse 4
19.1, 18.3, 18.8
18.73
0.3267
0.1633
Mouse 5
18.6, 21.6, 16.6
18.93
12.6667
6.3333
Mouse 6
21.0, 17.8, 20.1
19.63
5.4467
2.7233
a. A classmate asks you to explain the difference between a random and fixed effect. Should
mouse be treated as a random or fixed effect? Why?
Mice were sampled randomly for this study and no specific interest to these
selected mice was indicated. Interest in analyzing mouse to mouse variation and
sample to sample variation.
b. Write the linear model for this mouse tissue data. List the assumptions of the model.
yij    ai  eij
ai ~ N  0,  a2 
iid
eij ~ N  0,  e2 
iid
c. Individual variances for each mouse show a range of 0.1633 to 11.5833. What test would you
recommend before running an analysis of variance. Write the null and alternative hypothesis for
this test.
A homogeneity of variance test, such as Levene’s test or Brown=Forsythe’s test should be used
to determine if the sample variation within each mouse is homogeneous across all mice.
H o :  12   22   32   42   52   62   2
H1 : at one  i2   2
4
If a theory doesn’t square with experiment, it’s wrong. Richard Feynman’s talk The key to Science:
http://www.openculture.com/2011/04/richard_feynman_talks_science_and_bill_gates_posts_talks_online.html
August 4, 20111
NCSU ST512
Final Exam
Sum 2 2011
4. A factorial experiment has quantitative factors A at 3 equally spaced
levels and B at 4 equally spaced levels. The 10 replications are in
blocks. Here are the totals for A and B, each being a total of 10
original observations:
b0
bl
b2
b3
Polynomials
+--------------------------+
a0 : 530 : 700 : 720 : 850
:
:------:-----:-----:-------:
al : 4l0 : 500 : 620 : 700
:
:------:-----:-----:-------:
a2 : 400 : 470 : 500 : 650
:
+--------------------------+
Linear Orthogonal
4 levels
3 levels
+--------------------------: -3
-l
l
3
:
: -l
0
l
:
A
Sum
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
a0
2800
a1
2230
a2
2020
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
B
Sum
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
b0
1340
b1
1670
b2
1840
b3
2200
a0
a1
a2
b0
530
b1
700
b2
720
b3
850
b0
410
b1
500
b2
620
b3
700
bo
400
b1
470
b2
500
b3
650
Q
SS(Q)
AL
-1
-1
-1
-1
0
0
0
0
1
1
1
1
-780
7605
BL
-3
-1
1
3
-3
-1
1
3
-3
-1
1
3
-2750
12604.17
ALxBL
3
1
-1
-3
0
0
0
0
-3
-1
1
3
-200
100

r  c j  10  4  1  0  1
AL
2

2
  80
r  c j  10  3  3   1  1   3
BL

2
2
2
r  c j  10  2  3   1  1   3
BL
2
2
BLOCK SS =
2
2
  600
  400
5000
Total SS = 28000
TREATMENT SS = 21582.50
5
2
SS  AL  
QA2L
SS  BL  
QB2L
80
600
SS  AL BL  


QA2L
400
 780 
2
 7605
80
 2750 
2
600

 200 
400
 12604.17
2
 100
Error DF = (4*3-1)*(10-1) = 99
SS(Error)= 28000-21582.5-5000 = 1417.5
MSE = 1417.5/99 = 14.3182
If a theory doesn’t square with experiment, it’s wrong. Richard Feynman’s talk The key to Science:
http://www.openculture.com/2011/04/richard_feynman_talks_science_and_bill_gates_posts_talks_online.html
August 4, 20111
NCSU ST512
Final Exam
Sum 2 2011
a) Compute the sums of squares for:
AL = A linear
7605.00
BL = B linear 12604.17
AL x BL
SS(AL
and BL
100.00
and AL x BL) = 7605.00+12604.17+100.00 = 20309.17
b) The test statistic which test the null hypothesis that nothing other
than the above effects is needed to describe the effects of A and B,
F = _ 11.12 _
c) How many numerator_
_ denominator _ 99 _ degrees of freedom for F?
Sources
df
Sum of
Squares
BLOCK
10-1 = 9
5000
Treatment Comb
3*4-1 = 11
21582.5
AL
1
7605.0
BL
1
12604.17
AL*BL
Deviations from
Linear in A, B, A*B
6
8
Mean
Square
F
11.12
1*1 = 1
100.00
11-3 = 8
1273.33
159.1662
14.3182
Error
(3*4-1)(10-1)
= 99
1417.5
Total
3*4*10-1 = 119
28000
If a theory doesn’t square with experiment, it’s wrong. Richard Feynman’s talk The key to Science:
http://www.openculture.com/2011/04/richard_feynman_talks_science_and_bill_gates_posts_talks_online.html
August 4, 20111
NCSU ST512
Final Exam
Sum 2 2011
5. The utility of oyster shell as liming material for crop cultivation is to be investigated in a
study where fresh and composted shell meals were compared as lime fertilizers to reduce
acidity and improve conditions of the soil when growing soybean under field condition in
Sandhills, NC. The field experiment will include two varieties of Soybean, one well
established and a new hybrid being developed; and four liming treatments: control (normal
crop cultivation practices, no additional lime treatment) , fresh oyster shell meal,
composted oyster shell meal, and commercial lime. The land was laid out by randomized
complete block design (RBCD) with three replications. Each block had eight plots for a
total number of 24 plots. An analysis of variance was run to analyzed the effect of these two
factors on soybean yield (kg.ha-1 ) .
a) Layout the distribution of treatments on two replicates.
a1b3
a1b1
a2b4
a2b2
a1b4
a2b3
a1b2
a2b1
a2b2
a1b3
a1b4
a2b1
a1b2
a2b3
a1b1
a2b4
b) Give the sources, degrees of freedom, and expected mean squares for
the resulting analysis of variance table.
Model :
yijk     i   j   ij   k  eijk
eijk
N  0,  2 

i
0

j
  
0
ij
0
Analysis of Variance Table
7
Sources
df
BLOCK
3-1 = 2
Cultivar
2 – 1 = 1
Liming Treatment
4 – 1 = 3
Cultivar*Liming
Treatment
1*3 = 3
Error
(3-1)(8-1) = 14
Total
3*4*2-1= 23
Sum of
Squares
Mean
Square
E(MS)
If a theory doesn’t square with experiment, it’s wrong. Richard Feynman’s talk The key to Science:
http://www.openculture.com/2011/04/richard_feynman_talks_science_and_bill_gates_posts_talks_online.html
August 4, 20111
NCSU ST512
Final Exam
Sum 2 2011
c) Present a set of orthogonal contrasts to analyze the effect of
liming treatments.
C1: “Shell Treatments” vs “Commercial Liming Treatment”
C2: “Fresh Shell vs Composted Shell”
C3: “Control vs Liming Treatment”
Contrast
Control
Orthogonal Set
Shell vs
0
Commercial
Fresh vs
0
Composted
Control vs
-3
Liming Treat
Orthogonal Set
Fresh vs
0
Composted
Control vs
-1
Commercial
Liming Treat
Shell vs
-1
Others
8
Fresh
Shell
Composted
Sell
Commercial
Liming
Treatment
-1
-1
2
-1
1
0
1
1
1
-1
1
0
0
0
1
1
1
-1
If a theory doesn’t square with experiment, it’s wrong. Richard Feynman’s talk The key to Science:
http://www.openculture.com/2011/04/richard_feynman_talks_science_and_bill_gates_posts_talks_online.html
August 4, 20111