Description Usage Format Source References Examples
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.
1 |
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.