Compute the least squares regression line and the least


Attach the data set SHIP (or ship) included in the standard S-Plus distribution package, and make sure that the data are stored in a vector. Use the command:
> SHIP

if needed. Create a vector TIME containing the integers ranging from 1 to the number of entries in the vector SHIP.

1. Compute the least squares regression line and the least absolute deviations regression line of SHIP versus TIME and superimpose these two lines onto the scatterplot of TIME and SHIP. Compare the ways in which these lines account for the upward trend in the data and explain the differences

2. The purpose of this question is to fit a more general polynomial (i.e. of degree possibly greater than 1) to the SHIP data. Perform polynomial regressions of degrees 2, 4, 6, and 8 successively, plot the results, and choose the value of the degree which seems the most reasonable.

3. The purpose of this question is to use natural splines to smooth the data SHIP. Vary the number of degrees of freedom (i.e. the parameter df). Use the values 2, 6, 10, 14 and 18 for the number of degrees of freedom (i.e. the parameter df) and for each of them fit a natural spline to the data. Explain how the smoothed curve changes with the value of the number of degrees of freedom and choose the one which seems the most reasonable.

4. Finally we smooth the SHIP data using a kernel smoother ksmooth with a normal kernel function. Use the values 1, 5, 20, 50 and 125 for the bandwidth, and for each of these values, superimpose the graph of the kernel scatterplot smoother on the actual scatterplot of the original data. Explain how the smoothed curve changes with the bandwidth.

Request for Solution File

Ask an Expert for Answer!!
Financial Management: Compute the least squares regression line and the least
Reference No:- TGS01625681

Expected delivery within 24 Hours