Practical Computing Exercise for Week 4: The first Beetles exercise

Download the template R markdown file for this workshop.

Aims of this practical exercise

In this exercise you will:

  • rework some of the example given in ELMER
  • fit a variety of models to the Beetles data involving a variety of transformations.
  • use iteratively re-weighted regression to fit a model to this data.

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(Beetles, package="ELMER")
str(Beetles)
'data.frame':   8 obs. of  5 variables:
 $ Dose     : num  1.69 1.72 1.76 1.78 1.81 ...
 $ NoBeetles: int  59 60 62 56 63 59 62 60
 $ NoKilled : int  6 13 18 28 52 53 61 60
 $ Prop     : num  0.102 0.217 0.29 0.5 0.825 ...
 $ TProp    : num  0.325 0.484 0.569 0.785 1.14 ...

The Exercise

Fit the model \[\mu_Y = \beta_0 + \beta_1 Dose\] to the beetle mortality data using iterative reweighting based on Y having a binomial distribution. Compare the predictions with those from the arcsine transformation.

Solutions

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