Practical Computing Exercise for Week 7: Wedderburn’s leaf blotch data

Download the template R markdown file for this workshop.

Aims of this practical exercise

In this exercise you will:

  • compare use of family="binomial" versus family="quasibinomial"

The exercise

Wedderburn’s leaf blotch data represents the proportion of leaf blotch on ten varieties of barley grown at nine sites in 1965. The amount of leaf blotch is recorded as a percentage. Obtain the data using:

and answer the following questions.

  1. obtain the data and check that variety and site are correctly defined.

  2. fit a GLM that is appropriate for this data, assuming the data are binomially distributed.

  3. Why can’t we fit the interaction model here.

  4. produce a plot of the residuals vs the predicted values for this model and identify any problems that might exist.

:\{r plotLeaf.glm} plot(Leaf.glm,which=1)

  1. fit the following model.
Leaf.glm.quasi = glm(Prop~Site+Variety, family=quasibinomial(), data=LeafBlotch, weights=rep(100, nrow(LeafBlotch)))
  1. produce a plot of the residuals vs the predicted values and identify if this is a better option than using the previous model.

:\{r plotLeaf.glm.quasi} plot(Leaf.glm.quasi, which=1)

  1. What is the dispersion parameter for this model?

  2. Describe the effect site and variety have on the proportion of leaf blotch.

Solutions

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

As an aside…

The agridat package includes this dataset and calls it wedderburn.barley. The help page for it presents several other ways to model the proportion that are beyond the expected learning for the 161.331 course. You might investigate if you have lots of time on your hands, or after the conclusion of the semester.