Learn R Programming

agridat (version 1.23)

wheatley.carrot: Insecticide treatments for carrot fly larvae

Description

Insecticide treatments for carrot fly larvae. Two insecticides with five depths.

Usage

data("wheatley.carrot")

Arguments

Format

A data frame with 36 observations on the following 6 variables.

treatment

treatment factor, 11 levels

insecticide

insecticide factor

depth

depth

rep

block

damaged

number of damaged plants

total

total number of plants

Details

In 1964 an experiment was conducted with microplots to evaluate the effectiveness of treatments against carrot fly larvae. The treatment factor is a combination of insecticide and depth.

Hardin & Hilbe used this data to fit a generalized binomial model.

Famoye (1995) used the same data to fit a generalized binomial regression model. Results for Famoye are not shown.

References

James William Hardin, Joseph M. Hilbe. Generalized Linear Models and Extensions, 2nd ed.

F Famoye (1995). Generalized Binomial Regression. Biom J, 37, 581-594.

Examples

Run this code
if (FALSE) {

library(agridat)

data(wheatley.carrot)
dat <- wheatley.carrot

# Observed proportions of damage
dat <- transform(dat, prop=damaged/total)
libs(lattice)
xyplot(prop~depth|insecticide, data=dat, subset=treatment!="T11",
       cex=1.5, main="wheatley.carrot", ylab="proportion damaged")

# Model for Wheatley. Deviance for treatment matches Wheatley, but other
# deviances do not.  Why?
# treatment:rep is the residual
m1 <- glm(cbind(damaged,total-damaged) ~ rep + treatment + treatment:rep,
          data=dat, family=binomial("cloglog"))
anova(m1)

# GLM of Hardin & Hilbe p. 161. By default, R uses T01 as the base,
# but Hardin uses T11. Results match.
m2 <- glm(cbind(damaged,total-damaged) ~ rep + C(treatment, base=11),
          data=dat, family=binomial("cloglog"))
summary(m2)
}

Run the code above in your browser using DataLab