Homework No.2 (Due date: March 9th)
[Remark: Throughout the class, our homeworks will (mostly) have
different assignments for R and SAS. You have the choice to do one set
of assignments (R or SAS) or do both sets (both R and SAS). If you do
both sets, the homework score will be calculated by: max(R assigmnet
score, SAS assignment score) + a separate bonus score of 10 points.
Problem 1: For the data set ("animals.dat")
contains body weights and brain weights of 27 species.
i) Use [a] read.table() and [b] data.frame()/scan() functions
to read the data into R.
ii) Produce a scatter plot (with the fitted regression line).
iii) Fit a linear regression model to the data and report your findings.
iv) Provide appropriate diagnostic analysis.
Problem 2: Write your own R function
to compute DFFITS, and test it on the "animals.dat" studied
in Problem 1. (Please include your R code -- try your best to make the code concise).
Problem 3: The Janka hardness data
gives the density (Dens) and hardness (Hard) of a sample of Australian
Eucalypt hardwoods. The problem is to build a prediction equation for hardness
in terms of density. ( See dataset junka here.
Problem 1: page 135-136, 5-1
Problem 2: page 136, 5-6
Problem 3: page 178, 7-2
problem 4: page 247, 9-1.
Also, provide appropriate diagnostic analysis.