I have a capture-mark-recapture dataset that I am analyzing using a basic CJS approach. While the data set spans 28 years, sampling only occurred for 19 of the seasons.
For all individuals captured, we were able to determine age, and new individuals were added in every sampling season. From these data, I created an input file for RMark that consists of the capture history, an age matrix (the age of each individual for every season, captured or not), and a vector of the initial age at capture (see the data file's header below).In the age matrix, there is one column for every sampling season, and they are numbered to represent the intervals between the sampling seasons.
- Code: Select all
ch CGage1 CGage3 CGage4 CGage5 CGage6 CGage8 CGage10 CGage11 CGage13 CGage14 CGage17
1 1101010000000000000 11 13 14 15 16 18 20 21 23 24 27
2 0000000001000000000 0 0 0 0 0 0 0 0 0 0 3
3 0100010000000000000 1 3 4 5 6 8 10 11 13 14 17
4 0000001011101110011 0 0 0 0 0 2 4 5 7 8 11
5 0000000000000000010 0 0 0 0 0 0 0 0 0 0 0
6 0000010000101010011 0 2 3 4 5 7 9 10 12 13 16
CGage18 CGage19 CGage20 CGage21 CGage22 CGage23 CGage28 CGage29 InitAge
1 28 29 30 31 32 33 38 39 12
2 4 5 6 7 8 9 14 15 1
3 18 19 20 21 22 23 28 29 4
4 12 13 14 15 16 17 22 23 5
5 0 0 0 0 0 1 6 7 7
6 17 18 19 20 21 22 27 28 8
I am thus treating age (CGage) as a time-varying covariate.
There have been no issues with running the models. The problem comes when I try to use covariate.predictions to extract the age-specific survival rates.
- Code: Select all
age.spec <- mark(data=LP_surv, model="CJS", time.intervals=TimeInt, model.parameters = list(Phi=list(formula=~CGage), p=list(formula=~-1+time)))
CovData <- data.frame(ClemAge=0:38)
age.spec.predictions <- covariate.predictions(age.spec, data=CovData, indices=c(1:18))
I want the program to compile the survival rates for each age. However, instead of providing values for the given range (0:38), the output gives real parameter estimates for each index value (1:18) and repeats that set of values 38 times (essentially just the season-to-season survival). I have also tried using the Initial Age vector as an input, but this does not reflect the full capture history for the different ages.
I have previously e-mailed Jeff about this problem, but I am still unable to figure out how to fix my code.
Thank you for the help!
Some clarification:
- Because the ages range from 0-38, it is unwieldy to separate them into groups by each age.
- I'm not sure why it's the case, but there seems to be a problem with having different age values in each column as I have been able to use covariate.predictions successfully when each column consists of the same value and I use the header names in the models.