Format time-varying covariates

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

Format time-varying covariates

Postby j.harv3y » Tue Feb 26, 2019 7:28 am

Hi all,
I'm quite stuck and would be really grateful for any guidance!
Could someone explain how time-varying individual covariates should be set up in R? I've looked through the Mark book, including C.16. However I can't seem to find an explanation on the actual covariate layout within R. In the Dipper example they seem to have a single covariate for each encounter history string (e.g 00110) however how can the second time-varying covariate for the second sighting (e.g 00110) be included?
Thanks so much in advance, you're all amazing!
Jess
j.harv3y
 
Posts: 45
Joined: Mon Oct 08, 2018 4:45 am

Re: Format time-varying covariates

Postby j.harv3y » Tue Feb 26, 2019 7:37 am

* apologies, this appears to have posted twice and I can't seem to delete the other post!
j.harv3y
 
Posts: 45
Joined: Mon Oct 08, 2018 4:45 am

Re: Format time-varying covariates

Postby jlaake » Tue Feb 26, 2019 9:48 am

I am not quite sure what you are asking. There are only 2 things you need to know. First, all time varying individual covariates must have a value. None can be missing which limits their usefulness. Second, they must be named with some name prefix like cov and the suffix is the value of the time for each occasion. For example, cov1,cov2,... Then you would use cov in the formula. If for example you set begin.time to 1990 then they would be named cov1990,cov1991,... if time.intervals were 1. The values of each covariates are provided in the data file with the capture history.
jlaake
 
Posts: 1197
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Format time-varying covariates

Postby Eurycea » Thu Sep 10, 2020 4:45 pm

I was wondering the same thing- about formatting these. I plan to use RDHuggins which will condition on the first capture. If I impute missing values for covariates after the first encounter, (for any encounter not observed) will MARK and/or RMark accept "NA" as values prior to the first encounter? In my case, they would be session specific covariates for determining effects on S and gammas.

THanks
Eurycea
 
Posts: 90
Joined: Thu Feb 25, 2010 11:21 am

Re: Format time-varying covariates

Postby jlaake » Thu Sep 10, 2020 5:05 pm

To be clear this subject should be "Time varying individual covariates". If it is not an individual covariate then it would be added into the design data and not the individual data.

As the previous post states they cannot be missing and MARK gives an error with an NA that the value was not a real. The only exception for missing values is when the data are not used. For example, for a CJS model with capture history 0101. The covariate value for p for the first two occasions could be missing because it is not used in the likelihood but use 0 (actually any numeric is fine) instead of NA or MARK will give an error. For survival, the first could be missing (eg 0) but the second would have to be available because it is for the interval from the second occasion to the third.

If you have missing values after the first 1 - you are out of luck. No capacity for missing covariate values in MARK.
jlaake
 
Posts: 1197
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Format time-varying covariates

Postby Eurycea » Thu Sep 10, 2020 5:18 pm

As the previous post states they cannot be missing and MARK gives an error with an NA that the value was not a real. The only exception for missing values is when the data are not used.


This is what I assume is the case for the RDHuggins.

For example- three periods, two sampling events per occasion, with covariates on each session (three rows of covariate data).

100010 would use a covariate from three columns of covariate data (for each occasion).
but
000010 would only use a covariate from the last column of data.

So if I understand you correctly, for the 2nd example I give I could pad the preceeding values before that individual enters the population with any value, because they will not be used.

FWIW I plan on interpolating size data from a growth model, as this seems more accurate than using a multi-state approach where transition rates would probably very poorly approximate a growth rate. The question is whether temporary emigration is higher for the larger of two size classes (to keep it simple).

Many thanks for your insights.
Eurycea
 
Posts: 90
Joined: Thu Feb 25, 2010 11:21 am


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest