Description Usage Format Source References Examples
The data are the numbers of reptile and amphibian species and the island areas for seven islands in the West Indies.
1 |
A data frame with 7 observations on the following 2 variables.
area of island (in square miles)
number of reptile and amphibian species on island
Ramsey, F.L. and Schafer, D.W. (2013). The Statistical Sleuth: A Course in Methods of Data Analysis (3rd ed), Cengage Learning.
Wilson, E.O., 1992, The Diversity of Life, W. W. Norton, N.Y.
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 | str(case0801)
attach(case0801)
## EXPLORATION
logSpecies <- log(Species)
logArea <- log(Area)
plot(logSpecies ~ logArea, xlab="Log of Island Area",
ylab="Log of Number of Species",
main="Number of Reptile and Amphibian Species on 7 Islands")
myLm <- lm(logSpecies ~ logArea)
abline(myLm)
## INFERENCE AND INTERPRETATION
summary(myLm)
slope <- myLm$coef[2]
slopeConf <- confint(myLm,2)
100*(2^(slope)-1) # Back-transform estimated slope
100*(2^(slopeConf)-1) # Back-transform confidence interval
# Interpretation: Associated with each doubling of island area is a 19% increase
# in the median number of bird species (95% CI: 16% to 21% increase).
## DISPLAY FOR PRESENTATION
plot(Species ~ Area, xlab="Island Area (Square Miles); Log Scale",
ylab="Number of Species; Log Scale",
main="Number of Reptile and Amphibian Species on 7 Islands",
log="xy", pch=21, lwd=2, bg="green",cex=2 )
dummyArea <- c(min(Area),max(Area))
beta <- myLm$coef
meanLogSpecies <- beta[1] + beta[2]*log(dummyArea)
medianSpecies <- exp(meanLogSpecies)
lines(medianSpecies ~ dummyArea,lwd=2,col="blue")
island <- c(" Cuba"," Hispaniola"," Jamaica", " Puerto Rico",
" Montserrat"," Saba"," Redonda")
for (i in 1:7) {
offset <- ifelse(Area[i] < 10000, -.2, 1.5)
text(Area[i],Species[i],island[i],col="dark green",adj=offset,cex=.75) }
detach(case0801)
|
'data.frame': 7 obs. of 2 variables:
$ Area : int 44218 29371 4244 3435 32 5 1
$ Species: int 100 108 45 53 16 11 7
Call:
lm(formula = logSpecies ~ logArea)
Residuals:
1 2 3 4 5 6 7
-0.0021358 0.1769753 -0.2154872 0.0009468 -0.0292440 0.0595428 0.0094020
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.93651 0.08813 21.97 3.62e-06 ***
logArea 0.24968 0.01211 20.62 4.96e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.1283 on 5 degrees of freedom
Multiple R-squared: 0.9884, Adjusted R-squared: 0.9861
F-statistic: 425.3 on 1 and 5 DF, p-value: 4.962e-06
logArea
18.89433
2.5 % 97.5 %
logArea 16.357 21.48699
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.