Page 1 of 1

Time varying covariates with time.intervals argument

PostPosted: Fri Sep 27, 2024 11:31 am
by felixsmith
Good evening all,

I am currently running some multistate models in Rmark and am running into some errors and would appreciate any guidance that might help solve them.

Firstly some background on my dataset. My data runs from 1988 to 2023 with two missing years where no data was collected (2007 and 2008). My standard sampling period in each year is June-October (inclusive) but for some years the sampling periods are shorter. To describe this I have used the arguments begin.time=1988 and time.intervals in the process.data function. To calculate time intervals between my sampling period I calculated the difference between the end of sampling period n and the beginning of sampling period n+1 in years, i.e. 12 months = 1, 3 months = 0.25.

Some of the models I am running have two year specific features. First of these is a binary extreme climatic event variable with each year defined as either “pre” or “post” event in the design data. Secondly I have an individual effort variable for each individual in the dataset for each sampling period. These columns are labelled effort1988, effort1989 etc. There are no effort columns for the missing years, 2007 and 2008. I make a call to the effort in some of my capture parameters, e.g., p.effort=list(formula=~effort).

When running my models I am running into errors with models that include these two year specific features. None of the models that include the climatic event variable or the effort variable run. Below is one such error I experience with any model that includes the effort variable:

“Error in make.mark.model(data.proc, title = title, parameters = model.parameters, :
Error: Variable effort used in formula is not defined in data”

I suspect that there is some problem with the time intervals that means that my capture histories are not aligned correctly with each year.

I have the following questions:

a) Have I set up my time intervals correctly? Or should these be calculated in relation to 1 “standard” time interval (i.e. November-May, 7 months)?

b) Do I need to specify the effort as a variable? My understanding was that a covariate that is not named in the data and has a time appropriate suffix will be treated as a time varying covariate automatically.

c) Am I correct in my suspicion that there is a mis-alignment between the sampling periods and capture histories and is there anyway to “re-align” these.

Many thanks in advance!

Re: Time varying covariates with time.intervals argument

PostPosted: Fri Sep 27, 2024 6:47 pm
by jlaake
When you use a time varying individual covariate then there has to be a covariate for each entry in the design data for the variable. This becomes problematic when you use decimal time values as well. Fortunately you don't need a time varying individual covariate because the effort is presumably not varying for each individual animal. What you want to do is to add the effort value to each row in the design data for p. Any time a covariate doesn't vary by individual you should be thinking design covariates. See section 6.7 of the RMark workshop notes.

--jeff