Extracting age-specific survival with covariate predictions

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

Extracting age-specific survival with covariate predictions

Postby cyfeng » Thu Sep 08, 2016 1:51 am

I have been struggling with this problem for a while and would appreciate any input.

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.
cyfeng
 
Posts: 2
Joined: Mon Aug 29, 2016 3:32 pm

Re: Extracting age-specific survival with covariate predicti

Postby jlaake » Thu Sep 08, 2016 11:34 am

I'm fairly certain this question has been asked multiple times on this list. Please search the site before posing a question. The problem has always been the same where the name in the data frame for the argument data to covariate.predictions is different than the name used in the model. From help file ?covariate.predictions

The argument data is a dataframe containing values for the covariates used in the models. The names for the fields should match the names of the covariates used in the model. If a time-varying covariate is used then you need to specify the covariate name with the time index included as it is specified in the data.


It is also in the workshop notes. Thus you need to make a dataframe with the values CGage1,...CGage29. You used ClemAge. You should also add the field index to that dataframe such that CGage1 is with the index for time 1, etc. If instead you were to use the indices argument like you have you would get estimates for indices 1 to 18 for CGage1, etc which would not make sense because CGage1 is only for time 1.

In the next version I'll add a check to see if any specified variable names don't match those used in the model which hopefully will prevent this problem from re-occurring.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Extracting age-specific survival with covariate predicti

Postby cyfeng » Thu Sep 08, 2016 2:46 pm

Jeff,

Thanks for pointing out the error there. I fixed the mismatch and re-ran covariate.predictions for values CGage1:CGage10 and was able to get those values:

Code: Select all
$estimates
  vcv.index model.index par.index covar2 index  estimate         se       lcl       ucl fixed
1         1           1         1 CGage1     1 0.8360517 0.02541210 0.7800164 0.8800090     
2         2           2         2 CGage2     2 0.8425406 0.02330279 0.7913331 0.8830389     
3         3           3         3 CGage3     3 0.8464023 0.02208446 0.7979783 0.8848934     
4         4           4         4 CGage4     4 0.8502428 0.02090325 0.8045126 0.8867808     
5         5           5         5 CGage5     5 0.8540595 0.01976229 0.8109261 0.8887034     
6         6           6         6 CGage6     6 0.8618755 0.01754183 0.8237760 0.8928096     
7         7           7         7 CGage7     7 0.8698422 0.01546802 0.8364137 0.8972785     
8         8           8         8 CGage8     8 0.8738735 0.01450495 0.8426012 0.8996723     


However, CGage_ refers to a column of values of individual ages for one season (and might be more appropriately labeled as Season1-Season29). These covariate predictions are thus giving me a specific year-to-year survival rate whereas the basic output gives season to season. These seasons were not spaced in even intervals, so now I can get survival from year 2 to year 3 (CGage2 = 0.8425) whereas from the basic output I could only get Season 1 to Season 3 survival. However, this lumps together the survival of all differently-aged individuals within that interval.

The examples I read through on the site are only seeking to get real parameter estimates for one variable represented as one covariate column. Instead, I want to treat all columns named with the CGage prefix collectively as an input matrix that tracks the turtle's age for every sampling season. From that, I want to get age-specific survivals across all seasons.

Alternatively (and preferably), I was wondering if there might be a way to change AGE (which is time-varying) to my known initial ages (shown in my original post). The default for this is "0" at time 0 for every individual, but my individuals entered the study at different points in time and at different ages.

Thanks again for the assistance!
cyfeng
 
Posts: 2
Joined: Mon Aug 29, 2016 3:32 pm


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest

cron