Budworm {pda} | R Documentation |
An experiment examined the toxicity of the pyrethroid trans=cypermethrin on the tobacco budworm Heliothis virescens. Batches of 20 budworm moths of each sex were exposed to the toxin for three days; the number dead or knocked down were reported.
data(Budworm)
A data frame with 194 observations on 4 variables.
[,1] | ldose | numeric | log base 2 of dose |
[,2] | dead | numeric | number dead of 20 |
[,3] | sex | factor | sex (M/F) |
Venables and Ripley (1999) Modern Applied Statistics with S-PLUS, 3rd ed., ch. 7.
Collett (1991, p. 75) Modelling Binary Data, Chapman & Hall, London.
data( Budworm ) Budworm.fit <- glm( dead ~ sex * ldose, data = Budworm, weight = total, family = binomial ) summary( Budworm.fit ) # Plot of Logit by Sex plot( c(1,32), c(0,1), type = "n", xlab = "dose", ylab = "prob", log = "x" ) text( 2^Budworm$ldose, Budworm$dead, as.character( Budworm$sex )) Budworm.ld <- seq( 0, 5, 0.1 ) for( i in levels( Budworm$sex )) lines( 2^Budworm.ld, predict( Budworm.fit, data.frame( ldose = Budworm.ld, sex = factor( rep (i, length( Budworm.ld )), levels = levels( Budworm$sex ))), type = "response" )) rm( Budworm.ld ) # Parameters for Lines summary( glm( dead ~ sex + ldose - 1, data = Budworm, weight = total, family = binomial ))$coefficients