Deviance residual plot - calculation issue

questions concerning analysis/theory using program MARK

Deviance residual plot - calculation issue

Postby SoConfused » Tue Apr 09, 2019 4:55 pm

Hello,

I'm running a set of CJS models. If I only run simple models and plot the deviance residuals, everything appears ok. However, as I add models to the set, I start getting residual plots where the software seems to calculate residuals using the encounter history as the observed value.

For example, if I click on one of these points, this is what I get in the deviance resid information pop up:
Encounter history number 57
Encounter history: 1010000000
Observed value: 1010000000
Expected value: 1.000
Residual value = 199652.4

What is happening?
SoConfused
 
Posts: 53
Joined: Wed Nov 05, 2014 8:25 am

Re: Deviance residual plot - calculation issue

Postby keevilm » Tue Aug 24, 2021 9:38 pm

Has this problem been resolved? We are also experiencing it with our POPAN JS analysis. In addition to the deviance residual plot, the problem also appears in the Observed and Expected when I select "List Observed and Expected in Excel" but not in "List Observed and Expected in Editor". I am concerned that the AIC and model rankings are affected; I am a bit less worried about residual plots.

Our analysis is complex because there are many groups (n groups = 21) to allow us to fit age models and to fix parameters to reflect the known timing and number of released individuals in our study and to fix detectability for radio-tracked individuals. I have simulated a simpler dataset that reproduces a similar (but not identical) problem. The simulated data INP file has 68 lines, 5 occasions, and 10 groups (1 batch each of males and females released prior to each occasion) with constant p and phi varying by sex and constant over intervals (if helpful, I would be happy post the encounter histories etc,). All pent and all N parameters are fixed to known values as described in this post viewtopic.php?f=1&t=4136
The first several rows and columns of the "List Observed and Expected in Excel" output look like:

Code: Select all
Encounter   Male 1   Male 1   Male  2   Male  2   Male 3   Male 3
History   Observed   Expected   Observed   Expected   Observed   Expected
11110   0   0.24733421   0   0.21985263   0   0.19237105
69561       0   69561   0   69561   0   69561
11100   0   0.53885134   0   0.47897897   0   0.4191066
22982       0   22982   0   22982   0   22982
10100   0   0.70136933   0   0.62343941   0   0.54550948
69933       0   69933   0   69933   0   69933
10010   0   0.41902486   0   0.37246654   0   0.32590822
85648       0   85648   0   85648   0   85648


Obviously numbers like 69933 are neither encounter histories nor valid expected values. Our actual data residual output does have encounter histories repeated as expected values, so that is a difference in the simulated data. I don't know what the source of "69933" is. For the simulated data, the first several rows and columns of the "List Observed and Expected in Editor" output look like:

Code: Select all
Encounter      Group 1          Group 1      Group 2          Group 2      Group 3          Group 3
 Histories     Observed         Expected      Observed         Expected      Observed         Expected
11110   0   0.24733421   0   0.21985263   0   0.19237105
11100   0   0.53885134   0   0.47897897   0   0.4191066
10100   0   0.70136933   0   0.62343941   0   0.54550948
10010   0   0.41902486   0   0.37246654   0   0.32590822
10000   2   3.515202   0   3.124624   0   2.734046
1110   0   0.71069309   1   0.63172719   0   0.55276129
1101   0   0.49377214   0   0.43890857   0   0.384045
1100   0   1.5483419   0   1.3763039   0   1.204266


These seem normal to me but it's the same weird values in the Excel output version that also end up being used to in the residual plot. Are they also used to calculate model deviance and possibly AIC or chat values?

For what it's worth, the estimated parameter values were a very close match to the simulated values so it seems that the model is fitted correctly. I would appreciate any insight into this, because I am stumped!
keevilm
 
Posts: 10
Joined: Wed Mar 17, 2021 10:17 pm

Re: Deviance residual plot - calculation issue

Postby keevilm » Thu Aug 26, 2021 8:49 am

I have figured out where numbers like "69561" are coming from and so a partial explanation for the problem by comparing the editor and Excel output. In the first row, the last column entry of the editor output has an expected value of is 0.15869561. In the Excel output, the first line is truncated at 0.158 and the next row starts with 69561 in the encounter history column and it is repeated across that row at each expected value.

The number of columns is determined by the number of groups (two columns per group), so with 10 groups (in my simulation test) the lines are slightly too long. The *.res file contents seem to match the coherent output to editor so a mostly uninformed guess is that the problem is with reading the *.res file. I still do not know if this is affecting model deviance and AIC calculations or whether the effects are limited to the excel output and plot.
keevilm
 
Posts: 10
Joined: Wed Mar 17, 2021 10:17 pm


Return to analysis help

Who is online

Users browsing this forum: No registered users and 20 guests

cron