SOLUTION_Quiz2_jul142011_vfinal2.pdf

Sum2 2011
NCSU
ST512
QUIZ 1
NAME
We are interested in studying the relationship, if any, between yield (Y, in bushels/acre), and
rainfall (X, inches/yr) on corn raised in farms of similar acreage and management located in
the midwest, during the period from 1890 to 1927. Our main goal is to find out an equation
that will help in the prediction of corn yield for a given rainfall.
We decided to run a multiple regression analysis after looking at a representation of the relationship
between Year, Rainfall and Yield
Model YIELD = RAINFALL YEAR
YEAR*RAIN
yi   o  1 x1i   2 x2i   3 x3i  ei
X 1  Rainfall
Regression model fitted
X 2  Year from 1890
X 3  X 1 *X2
Y= Yield

e ~ N 0, 2
i

Next we present the Analysis of variance table and parameter estimates.
1. Please fill in the missing entries.
Analysis of Variance
2.
Source
DF
Sum of
Squares
Mean
Square
F Value
Pr > F
Model
33
340.60856
113.53619
10.61
<.0001
Error
34
363.94197
10.70418
Corrected Total
37
704.55053
Give the null (and alternative) hypothesis tested by the overall F-test for the model .
1
July 07, 2011
Sum2 2011
NCSU
ST512
QUIZ 1
Next we have the table of Parameter estimates
3. Please fill in the missing entries.
Parameter Estimates
Variable
DF
Parameter
Estimate
Standard
Error
t Value
Pr > |t|
Type I SS
Intercept
1
4.48573
5.48728
0.82
0.4193
38707
X1
1
2.31128
0.50479
4.58
<.0001
114.21474
X2
1
1.08545
0.27376
3.96
0.0004
95.99361
-0.08781
0.02516
-3.49
0.0014
130.40020
X3
4. Write the estimated regression equation.
yi  4.49  2.31x1i  1.08x2i  0.09 x3i
yi  4.49  2.31x1i  1.08 x2i  0.09 x3i
 o  4.49 1  2.31  2  1.08 3   0.09
yi  1 x1i
x2i
 4.49 


2.31 
x3i  
 1.08 


 0.09 
5. Calculate an estimate for the conditional mean yield of farms raising corn in year 1900 receiving
a rainfall of 9 inch/year.
rainfall  9
year  1900
x1new  9
x2 new  1900  1890  10
x3new  x1new  x2 new  9 10  90
yi  4.49  2.31x1i  1.08 x2i  0.09 x3i
ynew  4.49  2.31 9   1.08 10   0.09  90 
 27.98
2
July 07, 2011
Sum2 2011
NCSU
ST512
QUIZ 1
The variance-covariance matrix for the estimates of the regression coefficients is presented next.
Covariance of Estimates
Variable
Intercept
rainfall
Intercept
30.110197368
-2.719640859
rainfall
-2.719640859 0.2548146526 0.1197135611
-0.01120618
YEAR1
-1.320670004 0.1197135611 0.0749470666
-0.006778894
YR_RAIN
0.1195693604
-0.01120618
YEAR1
YR_RAIN
-1.320670004 0.1195693604
-0.006778894 0.0006329419
6. Show how you would calculate the standard error of the conditional mean in 5. You do not need
to do the actual calculations
y  aβ
 
var  y   var aβ  aΣa

Σ  var β
 4.49 


2.31 

yi  1 x1i x2i x3i 
 1.08 


 0.09 
a  1 9 10 90 
 30.1102 2.7196 1.3207 0.1196  1 

 
2.7196 0.2548 0.1197 0.0112  9 
var  ynew   1 10 9 90  
 1.3207 0.1197 0.0749 0.0068  10 

 
 0.1196 0.0112 0.0068 0.0006  90 
s.e  ynew   var  ynew 
7. A researcher is analyzing the effect of the year by rainfall interaction, and ask your help. She
needs to draw the regression line between Yield and Rainfall at each of the following years:
1890, 1915 and 1935.
a. Compute the regression equation for each of these three years
3
July 07, 2011
Sum2 2011
x2i  0
NCSU
ST512
QUIZ 1
x1i = x1i  x2i  x1i  0  0
yi  4.49  2.31x1i  1.08  0   0.09  0 
yi  4.49  2.31x1i
x2i  25
x3i  x1i  x2i  x1i  25  25 x1i
yi  4.49  2.31x1i  1.08  25   0.09  25 x1i 
yi  4.49  2.31x1i  27  2.25 x1i
yi  31.49  0.06 x1i
x2i  35
x3i  x1i  x2i  x1i  35  35 x1i
yi  4.49  2.31x1i  1.08  35   0.09  35 x1i 
yi  4.49  2.31x1i  37.8  3.15 x1i
yi  42.29  0.84 x1i
Year
X2 = (Year-1890)
Intercept
Regression
coefficient (Slope
for rainfall)
1890
0
4.49
+2.31
1915
25
31.49
+0.06
1925
35
42.29
-0.84
b. Explain changes in these three slopes?
Changes in intercept and slope for regression equation of Y on X1 shows the effect of
a negative regression coefficient for the interaction between X1 and X2. Slope for
rainfall is 0 in year 1890, our baseline year, and 0.06 in year 1915 while in year 1925
is negative, -0.84, which indicates that while in year 1915, for one inch/yr increase in
rainfall, yield increases in 0.06units; for year 1925, for each inch/yr increase in rainfall,
yield decreases in 0.84 units
4
July 07, 2011
Sum2 2011
NCSU
ST512
QUIZ 1
8. I regressed Y on X1 and X2 getting these Type I and Type II sums of
squares from PROC REG.
What would have happened if I had run the
regression in the opposite order (PROC REG; MODEL Y = X2 X1; )
Variable
DF
Type I SS
INTERCEP
1
90000
18000
X1
1
800
900
X2
1
700
700
Model SS
Type II SS
1500
Fill missing entries
Variable
DF
Type I SS
INTERCEP
1
90000
18000
X2
1
__600_
__700_
X1
1
__900_
__900_
Model SS
1500
R(X1|X2)=900=1500-R(X2|  o )
5
Type II SS
R(X2|  o ) = 1500 – 900 = 600
July 07, 2011