Individual covariate in RMark - input and deviance issues

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

Individual covariate in RMark - input and deviance issues

Postby C. Le Coeur » Wed Mar 11, 2015 12:08 pm

Dear all,

I’ m running a robust design analysis using RMark with 12 primary sessions, each consisting of 5 trapping days. In the analysis, an individual covariate related to habitat (numeric variable from 0 to 1) is included.

My questions refer to the individual covariate input in RMark and the related deviance/AICc computations.
I read the capture history data from a text file and created the design data as follow:

Code: Select all
#capturedata.txt contains the capture history data followed by the sex group and the individual covariate (referred to as ‘habitat’)

squirrel=read.table("capturedata.txt",sep="\t",h=T)
time.intervals=c(0,0,0,0, 1,0,0,0,0, 0.31,0,0,0,0, 0.67,0,0,0,0, 0.34,0,0,0,0,0.33,0,0,0,0,0.34,0,0,0,0,0.29,0,0,0,0,0.31,0,0,0,0,0.42,0,0,0,0,0.31,0,0,0,0,0.29,0,0,0,0)

squirrel.process=process.data(squirrel, model = "Robust",time.intervals=time.intervals,groups=c("sex"))
squirrel.ddl=make.design.data(squirrel.process)

I didn’t mention the name and the number of individual covariate in this coding. However, the name was specified in capturedata.txt.

I run 2 models for which survival was considered i) constant and ii) as a function of the individual covariate ‘habitat’.
The two deviances were found very different whereas AICc values were surprinsingly close (according to the number of parameters and deviance values).

Code: Select all
                Npar      AICc      Deviance
S(~1)           28    1601.506   1883.738
S(~habitat)     29   1597.718   1536.682


To better understand the deviance differences, I performed the same models from 2 datasets, WITH and WITHOUT the individual covariate in MARK software.

Code: Select all
#From the dataset WITH individual covariates in MARK:
            Npar      AICc      Deviance
s(~1)            28   1600.882    1542.052
s (~habitat)     29   1596.856    1535.820

#From the dataset WITHOUT individual covariates in MARK:
          Npar      AICc      Deviance
s(~1)        28    1601.703    1883.934


Based on these results, we found quite close but not similar values of deviance and AIC between models in MARK and RMark (maybe due to different link functions). And the deviance of S(~1) in RMark refer to the deviance calculated from the capture history dataset WITHOUT covariate.

The expected deviance of S(~1) in RMark is 1542.052.
So, I was wondering:
- If RMark can adjust the AICc for models including individual covariate?? In that case, I can compare my models and the coding is correct (but see my last paragraph on ind. covariate plots)
- Or if my coding to input data or to define models in RMark was wrong? Do I need to mention the individual covariate before defining and running the set of models?


However, I get the same results using the function convert.inp:
squirrel=convert.inp("D:/capturedata.inp", group.df=data.frame(sex=c("Female","Male")), covariates=c("habitat"))

I used the individual covariate plot function in MARK as well as the covariate.predictions function in RMark to compare the effect of the individual covariate. I found both negative effect of the individual covariate but different fit (i.e. different values of survival rates and bigger CI in RMark)…

Any ideas what this is about? And how to solve it??

THANKS!
C. Le Coeur
C. Le Coeur
 
Posts: 13
Joined: Mon Feb 13, 2012 9:36 am

Re: Individual covariate in RMark - input and deviance issue

Postby jlaake » Wed Mar 11, 2015 12:20 pm

I'm not sure I understand your question completely but you should read the bottom of the second posting at

http://www.phidot.org/forum/viewtopic.php?f=21&t=2121

I'll partially reiterate here. If you create a dbf in the MARK interface with individual covariates, then any model (with or without the covariates) will give a deviance as if the covariates were included. However, in RMark, if you run a model without the individual covariate, that covariate is not included in the data and the resulting null deviance will differ in comparison to a run with the covariate. The deviance value in MARK is the residual deviance which is the total deviance (-2LnL) - null deviance. The null deviance changes with and without covariates. This does NOT affect AIC which uses -2LnL.

Hopefully this answers your question.

--jeff
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Individual covariate in RMark - input and deviance issue

Postby C. Le Coeur » Mon Mar 16, 2015 5:42 am

Thank you for your help Jeff! Now, I know for a certainty that the deviances of my models with and without individual covariates are correct in RMark.

But I’m still surprised to get different estimates of survivals (survival depends on the individual covariate) between Mark (using the individual covariate plot) and RMark (using the function covariate.predictions)..
Any ideas?
C. Le Coeur
 
Posts: 13
Joined: Mon Feb 13, 2012 9:36 am

Re: Individual covariate in RMark - input and deviance issue

Postby jlaake » Mon Mar 16, 2015 10:40 am

Sorry but I have no idea. You should try computing one manually. Is there more than one individual covariate in the model? Are there other factor variables in the model? Are you model averaging with covariate.predictions?
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to RMark

Who is online

Users browsing this forum: No registered users and 2 guests