Practical Computing Exercise for Week 3 :The Wool exercise

Download the template R markdown file for this workshop.

Aims of this practical exercise

In this exercise you will:

  • rework the example given in ELMER
  • get some practice using R markdown
  • fit a variety of models to the Wool data involving a variety of transformations.

Before you undertake this exercise…

You need to have installed R, RStudio, and the necessary packages for the course, including the ELMER package. See how to get set up for this course

Get the data

data(Wool, package="ELMER")
str(Wool)
'data.frame':   27 obs. of  5 variables:
 $ X        : int  1 2 3 4 5 6 7 8 9 10 ...
 $ Length   : int  -1 -1 -1 -1 -1 -1 -1 -1 -1 0 ...
 $ Amplitude: int  -1 -1 -1 0 0 0 1 1 1 -1 ...
 $ Load     : int  -1 0 1 -1 0 1 -1 0 1 -1 ...
 $ Cycles   : int  674 370 292 338 266 210 170 118 90 1414 ...

The Exercise

Re-create the graph for the residual sum of squares resulting from fitting first and second order models based on differing selections of \(\lambda\). N.B. To make a comparison using RSS, you will need to use the scale invariant form of the transformation.

Refine the search space for \(\lambda\), and evaluate the benefit of choosing a convenient value for \(\lambda\) as against the optimal value.

Solutions

You should compare your work with the solutions for this workshop.