Description Usage Format Source References Examples
Estimated number of adult female grizzly bears in the Greater Yellowstone population from 1959-1997.
1 |
A data frame with 39 rows on the following 2 variables.
year
Year of census
N
Estimated number of female grizzlies
Table 3.1 in Morris and Doak 2002. Original data from Eberhardt et al. 1986 and Haroldson 1999.
Morris, W. F., and D. F. Doak. 2002. Quantitative conservation biology: Theory and practice of population viability analysis. Sinauer, Sunderland, Massachusetts, USA.
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 47 48 49 50 | grizzly
## plot like Fig 3.6 (p. 66)
plot(grizzly$year, grizzly$N,
type = "o", pch = 16, las = 1, xlab = "Year",
ylab = "Adult females", main = "Yellowstone grizzly bears"
)
## calcualte log(Nt+1/Nt)
nt <- length(grizzly$N) ## number transitions
logN <- log(grizzly$N[-1] / grizzly$N[-nt])
## Mean and var
c(mean = mean(logN), var = var(logN))
## or using linear regression
## transformation for unequal variances (p. 68)
x <- sqrt(grizzly$year[-1] - grizzly$year[-length(grizzly$year)])
y <- logN / x
mod <- lm(y ~ 0 + x)
summary(mod)
## plot like Fig 3.7
plot(x, y,
xlim = c(0, 1.2), ylim = c(-.3, .3), pch = 16, las = 1,
xlab = expression(paste("Sqrt time between censuses ", (t[t + 1] - t[i])^{
1 / 2
})),
ylab = expression(log(N[t + 1] / N[t]) / (t[t + 1] - t[i])^{
1 / 2
}),
main = expression(paste("Estimating ", mu, " and ", sigma^2, " using regression"))
)
abline(mod)
## MEAN (slope)
mu <- coef(mod)
## VAR (mean square in analysis of variance table)
sig2 <- anova(mod)[["Mean Sq"]][2]
c(mean = mu, var = sig2)
## Confidence interval for mean (page 72)
confint(mod, 1)
## Confidence interval for sigma 2 (equation 3.13)
df1 <- length(logN) - 1
df1 * sig2 / qchisq(c(.975, .025), df = df1)
## test for outliers using dffits (p.74)
dffits(mod)[dffits(mod) > 2 * sqrt(1 / 38) ]
## plot like fig 3.11
plot(grizzly$N[-nt], logN,
pch = 16, xlim = c(20, 100), ylim = c(-.3, .3), las = 1,
xlab = "Number of females in year T",
ylab = expression(log(N[t + 1] / N[t])),
main = "Grizzly log population growth rates"
)
cor(grizzly$N[-nt], logN)
abline(lm(logN ~ grizzly$N[-nt]), lty = 3)
|
year N
1 1959 44
2 1960 47
3 1961 46
4 1962 44
5 1963 46
6 1964 45
7 1965 46
8 1966 40
9 1967 39
10 1968 39
11 1969 42
12 1970 39
13 1971 41
14 1972 40
15 1973 33
16 1974 36
17 1975 34
18 1976 39
19 1977 35
20 1978 34
21 1979 38
22 1980 36
23 1981 37
24 1982 41
25 1983 39
26 1984 51
27 1985 47
28 1986 57
29 1987 48
30 1988 60
31 1989 65
32 1990 74
33 1991 69
34 1992 65
35 1993 57
36 1994 70
37 1995 81
38 1996 99
39 1997 99
mean var
0.02134027 0.01305092
Call:
lm(formula = y ~ 0 + x)
Residuals:
Min 1Q Median 3Q Max
-0.21371 -0.07773 -0.02134 0.07740 0.24692
Coefficients:
Estimate Std. Error t value Pr(>|t|)
x 0.02134 0.01853 1.152 0.257
Residual standard error: 0.1142 on 37 degrees of freedom
Multiple R-squared: 0.0346, Adjusted R-squared: 0.008506
F-statistic: 1.326 on 1 and 37 DF, p-value: 0.2569
mean.x var
0.02134027 0.01305092
2.5 % 97.5 %
x -0.01620969 0.05889023
[1] 0.008674359 0.021844393
25
0.3807524
[1] 0.04120517
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.