Description Usage Format Details Source References Examples
This data was collected by J.A. Bishop. Bishop selected seven locations progressively farther from Liverpool. At each location, Bishop chose eight trees at random. Equal number of dead (frozen) light (Typicals) and dark (Carbonaria) moths were glued to the trunks in lifelike positions. After 24 hours, a count was taken of the numbers of each morph that had been removed—presumably by predators.
1 |
A data frame with 14 observations on the following 4 variables.
Morph, a factor with levels "light"
and "dark"
Distance from Liverpool (in km)
Number of moths placed
Number of moths removed
Population geneticists consider clines particularly favourable situations for investigating evolutionary phenomena. A cline is a region where two colour morphs of one species arrange themselves at opposite ends of an environmental gradient, with increasing mixtures occurring between. Such a cline exists near Liverpool, England, where a dark morph of a local moth has flourished in response to the blackening of tree trunks by air pollution from the mills. The moths are nocturnal, resting during the day on tree trunks, where their coloration acts as camouflage against predatory birds. In Liverpool, where tree trunks are blackened by smoke, a high percentage of the moths are of the dark morph. One encounters a higher percentage of the typical (pepper–and–salt) morph as one travels from the city into the Welsh countryside, where tree trunks are lighter. J.A. Bishop used this cline to study the intensity of natural selection.
Ramsey, F.L. and Schafer, D.W. (2013). The Statistical Sleuth: A Course in Methods of Data Analysis (3rd ed), Cengage Learning.
Bishop, J.A. (1972). An Experimental Study of the Cline of Industrial Melanism in Biston betularia [Lepidoptera] Between Urban Liverpool and Rural North Wales, Journal of Animal Ecology 41: 209–243.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | str(case2102)
attach(case2102)
## EXPLORATION AND MODEL BUILDING
proportionRemoved <- Removed/Placed
myPointCode <- ifelse(Morph=="dark",21,22)
myPointColor <- ifelse(Morph=="dark","blue","gray")
plot(proportionRemoved ~ Distance, pch=myPointCode, bg=myPointColor, cex=2, lwd=2)
binResponse <- cbind(Removed, Placed-Removed)
Morph <- factor(Morph, levels=c("light","dark")) # Make "light" the ref level
myGlm1 <- glm(binResponse ~ Distance + Morph + Distance:Morph, family=binomial)
summary(myGlm1) # Residual deviance: 13.230 on 10 degrees of freedom
1 - pchisq(13.230,10) # No evidence of overdispersion
myGlm2 <- update(myGlm1, ~ . - Distance:Morph)
anova(myGlm2, myGlm1) # Drop in deviance statistic = 11.931 on 1 d.f.
1 - pchisq(11.931,1) # p-value = 0.0005520753 => strong evidence of interaction
# It appears that the intercepts are the same for both light and dark morphs,
# that there is no effect of Distance for light morphs, but there is an effect
# of Distance for dark morphs.
## INFERENCE AND INTERPREATION
myTerm <- Distance*ifelse(Morph=="dark",1,0) # Create indicator var for "dark"
myGlm3 <- glm(binResponse ~ myTerm, family=binomial)
summary(myGlm3)
## GRAPHICAL DISPLAY FOR PRESENTATION
myPointCode <- ifelse(Morph=="dark",22,24)
myPointColor <- ifelse(Morph=="dark","blue","orange")
plot(proportionRemoved ~ Distance, ylab="Proportion of Moths Taken",
main="Proportions of Moths Taken by Predators at Seven Locations",
xlab="Distance from Liverpool (km)", pch=myPointCode, bg=myPointColor, cex=2,
lwd=2)
beta <- myGlm3$coef
dummyDist <- seq(0,55,length=50)
lp <- beta[1] + beta[2]*dummyDist
propDark <- exp(lp)/(1 + exp(lp))
lines(propDark ~ dummyDist,lwd=2,col="blue")
propLight <- rep(exp(beta[1])/(1 + exp(beta[1])),length(dummyDist))
lines(propLight ~ dummyDist,lwd=2,col="orange")
legend(0,0.47,legend=c("Dark Morph","Light Morph"),
pch=c(22,24),pt.bg=c("blue","orange"),pt.cex=c(2,2),pt.lwd=c(2,2))
detach(case2102)
|
'data.frame': 14 obs. of 4 variables:
$ Morph : Factor w/ 2 levels "dark","light": 2 1 2 1 2 1 2 1 2 1 ...
$ Distance: num 0 0 7.2 7.2 24.1 24.1 30.2 30.2 36.4 36.4 ...
$ Placed : int 56 56 80 80 52 52 60 60 60 60 ...
$ Removed : int 17 14 28 20 18 22 9 16 16 23 ...
Call:
glm(formula = binResponse ~ Distance + Morph + Distance:Morph,
family = binomial)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.21183 -0.39883 0.01155 0.68292 1.31242
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.717729 0.190205 -3.773 0.000161 ***
Distance -0.009287 0.005788 -1.604 0.108629
Morphdark -0.411257 0.274490 -1.498 0.134066
Distance:Morphdark 0.027789 0.008085 3.437 0.000588 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 35.385 on 13 degrees of freedom
Residual deviance: 13.230 on 10 degrees of freedom
AIC: 83.904
Number of Fisher Scoring iterations: 4
[1] 0.2110951
Analysis of Deviance Table
Model 1: binResponse ~ Distance + Morph
Model 2: binResponse ~ Distance + Morph + Distance:Morph
Resid. Df Resid. Dev Df Deviance
1 11 25.161
2 10 13.230 1 11.931
[1] 0.0005520753
Call:
glm(formula = binResponse ~ myTerm, family = binomial)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.1651 -0.5562 -0.1182 1.0186 1.6423
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.012663 0.090825 -11.150 < 2e-16 ***
myTerm 0.015596 0.003554 4.388 1.14e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 35.385 on 13 degrees of freedom
Residual deviance: 16.244 on 12 degrees of freedom
AIC: 82.918
Number of Fisher Scoring iterations: 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.