# [R] bootstrapping lambda values from projections matrices

Date: Fri 10 Feb 2006 - 00:45:41 EST

Dear all,

I'm working with a population projections matrix model from demographic data. The dominant eigenvalue of the matrix is the growth rate of the population (lambda). I would like to estimate confidence intervals for the lambda values with bootstrap.
The function for calculating the eigenvalue I wrote like this:

mat.fun <- function(d,i){

mat<-matrix(c(0,

```    sum(d\$klyear1[i]==1&d\$classyear2[i]==2)/sum(d\$classyear1[i]==1),
sum(d\$classyear1[i]==1&d\$classyear2[i]==3)/sum(d\$classyear1[i]==1), 0,
sum(d\$classyear1[i]==2&d\$classyear2[i]==2)/sum(d\$classyear1[i]==2),
sum(d\$classyear1[i]==2&d\$classyear2[i]==3)/sum(d\$classyear1[i]==2),
sum(d\$classyear1[i]==0&d\$classyear2[i]==1)/sum(d\$classyear1[i]==3),
sum(d\$classyear1[i]==3&d\$classyear2[i]==2)/sum(d\$classyear1[i]==3),
sum(d\$classyear1[i]==3&d\$classyear2[i]==2)/sum(d\$classyear1[i]==3),

```

sum(d\$classyear1[i]==3&d\$classyear2[i]==3)/sum(d\$classyear1[i]==3)),ncol=3)

abs(eigen(mat,only.values=T)\$values) }

Now, in the pooled matrix from all years I would like to sample in a way that the number of bootstrap samples taken from each year is equal to the number of data points from each year. Therefore I'm defining strata=year.

boot1 <- boot(myfile, mat.fun, 5000, strata=myfile\$year); boot1

Is this the correct way to do it or did I misunderstand the strata-argument? I checked in Davison, A.C. and Hinkley, D.V. (1997), but I'm still not quite sure.

Sincerely,

Avd. för växtekologi, Evolutionsbiologiskt centrum, Uppsala universitet Dept. of Plant Ecology, Evolutionary Biology Centre, Uppsala University

```Villavägen 14			tel: 018-471 2870 (int +46 18 4712870)
SE-752 36 Uppsala		fax: 018-55 34 19 (int +46 18 553419)