Question: #8520

Homework 2 STAT462 Complete Solution

Homework 2 - STAT 462
Fall 2015


Please bring a hard copy of your homework to class and submit it at the be- ginning of the class or submit it via ANGEL before class. You could either type or write down your answers. Attach your code used to obtain your re- sults. This is should be as neat as possible. Make sure your name is on it. . Deadline: 09/18/2015.


Exercise 1 (20 points)
Consider the Simple Linear Regression (SLR) model, Yi = 0 + 1Xi + i.
1. Suppose that the parameter values are 0 = 200, 1 = 5 and = 4.
(a) Plot the regression line. Show the distribution of Y for X =10; 20; 40.
(b) Explain the meaning of the parameters 0 and 1. Assume thatthe scope of the model includes X = 0.
(c) What is the implication for the SLR model if 1 = 0 so that themodel is Yi = 0 + i.


2. Let be 0 = 3, 1 = 􀀀2 and = 1:25. Set the seed for random numbergeneration in R: before your code, type set.seed(123).
(a) Create in R the observations for the predictor X: generate 100 observation from a normal distribution with = 0 and 2 = 1.

(b) Generate the response values, Yi, using the SLR model Yi = 0 + 1Xi + i.
(c) Create a scatterplot of Y vs X and compute the correlation coef-cient of Y and X. Comment on your results.


Exercise 2 (20 points)
A substance used in biological and medical research is shipped by airfreightto users in cartons of 1000 ampules.


Table 1: Airfreight breakage
i Xi Yi
1 1 16
2 0 9
3 2 17
4 0 12
5 3 22
6 1 13
7 0 8
8 1 15
9 2 19
10 0 11
The data (see Table 1), involving 10 shipments, were collected on the number of times the carton was transferred from one aircraft to another over the shipment route (X) and the number of ampules found to be broken upon arrival (Y). The least square estimates are b0 = 10:20 and b1 = 4:00. Using the sample observations and the the least square estimates
1. show that
Pn
i=1 ei = 0.
2. show that
Pn
i=1 Yi =
Pn
i=1
^ Yi.
3. show that
Pn
i=1 Xiei = 0.
4. show that
Pn
i=1
^ Yiei = 0.
2
5. check whether ( X ; Y ) falls on the regression line Y = b0 + b1X.(You can use R to facilitate your computations).


Exercise 3 (20 points)
Given the assumptions of a SLR model,
1. show that
Pn
i=1(Yi 􀀀 Y )2 =
Pn
i=1( ^ Yi 􀀀 Y )2 +
Pn
i=1(Yi 􀀀 ^ Yi)2;
2. give an interpretation for the regression sum of squares(SSR) and error sum of squares (SSE);
3. provide a formula and an interpretation for the coecient of determi- nation R2;
4. what is the link between R2 and XY ?


Exercise 4 (20 points)
Load the dataset \Diamond Rings" in R, where X=\Carats" and Y =\Price".
1. Compute in R, X
, Y ,
Pn
i (Xi 􀀀 X
),
Pn
i (Xi 􀀀 X
)2,
Pn
P i (Yi 􀀀 Y ) and n
i (Xi 􀀀 X
)(Yi 􀀀 Y ).
2. Use the previous quantities to estimate 0, 1 and 2.
3. Give an interpretation of the coecients of the estimated regression
function.
4. What is the tted value if \Carats"=0.20? What is the corresponding ei if yi = 498?
5. Create a scatterplot Y vs X and add the estimated regression line into the plot.

Exercise 5 (20 points)
In a study of the legibility and visibility of highway signs, a Pennsylvania re- search rm determined the maximum distance at which each of thirty drivers could read a newly designed sign. The thirty participants in the study ranged in age from 18 to 82 years old. The government agency that funded the re- search hoped to improve highway safety for older drivers, and wanted to examine the relationship between age and the sign legibility distance. Using R, read in the dataset \Highway.txt", where X=\age" and Y =\distance".


1. Compute in R, X
, Y ,
Pn
i (Xi 􀀀 X
),
Pn
i (Xi 􀀀 X
)2,
Pn
P i (Yi 􀀀 Y ) and n
i (Xi 􀀀 X
)(Yi 􀀀 Y ).
2. Use the previous quantities to estimate 0, 1 and 2. Give an inter- pretation of the coecients of the estimated regression function.
3. Create a scatterplot Y vs X and add the estimated regression line into the plot.
4. Check if SSTO=SSR+SSE.
5. Compute R2. Comment your result and check if R2 = 2
XY
 

Solution: #8530

Homework 2 - STAT462 Complete Solution

The parameter β0 = 200 indicated that the average value of the dependent variable Y is 200 when the independent variable X = 0. The pa...
Tutormaster
Rating: A+ Purchased: 11 x Posted By: Vikas
Comments
Posted by: Vikas

Online Users