what is the correct syntax for random effects in E-SURGE?

questions concerning analysis/theory using programs M-SURGE, E-SURGE and U-CARE

what is the correct syntax for random effects in E-SURGE?

Postby wisc88 » Wed Nov 08, 2017 4:48 am

I am trying to use E-SURGE to run a multi-event model with a fixed effect of time and a random effect of study area (Plot) on both steps of the transition (survival+transition). My model has 3 states, 7 events, 2 age classes and 8 occasions. Plot has 12 levels and all individuals are attributed to one Plot (i.e. there are no missing values).
I have successfully run models with Plot as a fixed effect (both t+Plot and t.Plot). Using individual as random effect (t+Plot+ind) also works fine. However, I cannot write the correct syntax to make GEMACO understand Plot as random.

I have tried the following phrases:
t+r(Plot) -> Call GEMACO does not work
t+random(Plot) -> Call GEMACO does not work
t+[i+r(Plot)] -> Call GEMACO works but I get errors when running the model

My E-SURGE version is 2.1.4.
Are these details enough to pinpoint my error?
Thank you for your help!
wisc88
 
Posts: 9
Joined: Mon Nov 06, 2017 11:35 am

Re: what is the correct syntax for random effects in E-SURGE

Postby simone77 » Thu Nov 30, 2017 10:35 am

Hi,

It could help knowing which error messages you get when you run the third phrase.
Did you try to run simpler model (e.g. [i+r(plot)]) to see if you get the same error messages? Sometimes GEMACO syntax may be a bit tricky and using slightly different syntax may solve problems. However, as in any other statistical model you may also have problems because of the amount of information you have (compared to the complexity of your model structure); for instance, have you checked how many individuals you have from each plot?

On the other hand, I wonder whether the model you are trying to run is very far from the "truth", sometimes I have had problems of convergence when I used a certain structure for a parameter that seemingly was not plausible for the data (what about the AIC and parameter identifiability of [t.plot] and [t+plot]?).
simone77
 
Posts: 197
Joined: Mon Aug 10, 2009 2:52 pm

Re: what is the correct syntax for random effects in E-SURGE

Postby wisc88 » Fri Dec 01, 2017 11:54 am

Hello simone77, thank you for your reply.

simone77 wrote:have you checked how many individuals you have from each plot?

I think the number of individuals in each plot is reasonable for a random effect:
plot = p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21
n = 84 73 84 84 62 63 96 64 56 108 81 87

simone77 wrote:It could help knowing which error messages you get when you run the third phrase.Did you try to run simpler model (e.g. [i+r(plot)]) to see if you get the same error messages?

For some reason I am now able to call GEMACO on all three sentences I wrote before. However, I still get the following error when I try to run them or the model you suggested [i+r(Plot)]:

"Not enough input arguments.
Error in modme/F1_age_evt_al (line 32)
Error in modme/f_age_al (line 20)
Error in menumuse>Run_Callback (line 1775)
Error in gui_mainfcn (line 95)
Error in menumuse (line 46)
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)menumuse('Run_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback"

Nothing changes if I write an equal sentence for survival and transition or if I keep one of them constant with the random effect only in the other.

The beta parameters that appear in IVFV seem ok. There is one(or two) beta with "al." after the betas for the fixed effects.

simone77 wrote:On the other hand, I wonder whether the model you are trying to run is very far from the "truth", sometimes I have had problems of convergence when I used a certain structure for a parameter that seemingly was not plausible for the data (what about the AIC and parameter identifiability of [t.plot] and [t+plot]?).

I had run [t.Plot] for survival and transition just as a way to try to find the problem. I know the amount of data I have is not enough to estimate well the huge number of parameters. This is actually the reason why I wanted Plot as a random effect in the first place! The model [t.Plot] converges, but with 13 possibly redundant parameters. The estimated rank equals the number of mathematical parameters (176).

Any ideas?
___
Uschi
wisc88
 
Posts: 9
Joined: Mon Nov 06, 2017 11:35 am

Re: what is the correct syntax for random effects in E-SURGE

Postby simone77 » Sun Dec 03, 2017 6:15 pm

Hi Uschi,

That error message in MATLAB (that runs beyond E-SURGE) pops out when a function does not contain the arguments it needs. Maybe that it helps if you write here the complete GEMACO phrases you have used for each parameter.
Also, how did you load “plot” when doing the covariate selection? As a Cluster or as a Group? Are there other covariates you have selected? How is “plot” defined in your data (e.g. in headed format: $COV:plot)?
I cannot see any obvious error in that sentence alone, it is likely that a more complete picture may help to figure out where the problem comes from.
simone77
 
Posts: 197
Joined: Mon Aug 10, 2009 2:52 pm

Re: what is the correct syntax for random effects in E-SURGE

Postby wisc88 » Mon Dec 04, 2017 3:53 pm

Hi Simone,
I am fitting a model with the structure described in <Culina et al. (2013): A multievent approach to estimating pair fidelity and heterogeneity in state transitions. Ecol. Evol. 3(13):4326–4338. DOI: 10.1002/ece3.729.>.
Briefly, it has one step for initial state, one for survival, one for transition and 3 for capture. I have 3 underlying states and 7 observable events. The sentences and matrices are:

-------- INITIAL -------------
to

i *

--------- TRANSITION --------
---survival---
i+r(Plot)

s - *
- s *
- - *

---transition---
i

t * -
t * -
- - *

---------- CAPTURE -----------
---step 1---
firste+nexte

* - - p -
- * - - p
- - * - -

---step 2---
firste.to(4 5,6)+nexte.to(4 5, 6)

* - - - - - - -
- * - - - - - -
- - * - - - - -
- - - c - c * -
- - - - c c - *

---step 3---
firste.from(8)+nexte.from(8)+from(2,3)

* - - - - - -
* - - - - - l
* - - - - - l
- * - - - - -
- - * - - - -
- - - * - - -
- - - - - * -
- - - - * l -

I have loaded Plot as a group. E-SURGE did not give me an option to load Plot as Cluster, maybe because it has less than 50 levels?
I have used the headed format with the column name $COV:Plot.
I have another categorical covariate (age, 2 levels) and 5 linear covariates.
I have created a shortcut for Plot as: g(1 2,3 4,5 6,7 8,9 10,11 12,13 14,15 16,17 18,19 20,21 22,23 24)

Does this information give you any clue?
wisc88
 
Posts: 9
Joined: Mon Nov 06, 2017 11:35 am

Re: what is the correct syntax for random effects in E-SURGE

Postby simone77 » Mon Dec 04, 2017 6:59 pm

Hi Uschi,

I cannot see anything weird in your GEPAT and GEMACO. Also, I think you are right that you have not the option to load Plot as a cluster because it has less than 50 levels. I am just not sure to understand well about the shortcut you say you created. Did you create the shortcut or did E-SURGE automatically create it for you (by combining the two-levels variable "age" and the 12-levels variable "Plot")? I have to ask just in case but I am pretty confident that you meant the second (E-SURGE did all the job) and that "age" is, therefore, g(1 3 5 7 9 11 13 15 17 19 21 23, 2 4 6 8 10 12 14 16 18 20 22 24).

Did you check wether you have individuals for all the combinations plot x age? I mean that, for instance, you have not zero individuals of a certain age in a certain plot. However, it is true that you are not using "age" in the phrase with the random effect so that it should not be a problem...actually it is difficult to figure out something without handling the data. I am sorry, I hope that others can give their contribution here.
Good luck!
simone77
 
Posts: 197
Joined: Mon Aug 10, 2009 2:52 pm

Re: what is the correct syntax for random effects in E-SURGE

Postby bfol » Wed Jan 24, 2018 10:58 am

Hello everyone,

I am currently working to assess the adult survival of Common Pochard in Europe since 1960 thanks to band-recovery data on E-SURGE. I combined data from different sites and for different years in Europe (in Switzerland, UK, Tour du Valat and Grand-Lieu). It is important to note that study periods are not necessarily identical for each site but I have always some individuals ringed each year in my final dataset. To be able to facilitate the assessment of a temporal trend, I gathered my study years in periods of 3 years (1960-62; 1963-65; 1966-68 ... 2016-18).

I know the sex, the banding age and the banding site for each individual. We have four different banding sites, hence I would like to integrate a “site” random effect on the survival.

This is an example of my data:

H:Y1960 H:Y1961 H:Y1962 … H:Y2016 H:Y2017 H:Y2018 S: $COV:Year $COV:Bage $COV:Sex $COV:Site
1 0 0 … 0 0 0 1 1960 AD F TDV
0 1 2 … 0 0 0 1 1961 AD M HE
0 0 0 … 0 0 0 1 1987 JUV M UK
0 0 0 … 1 0 0 1 2016 JUV F GL
0 0 0 … 1 0 2 1 2016 AD M GL
0 0 0 … 0 0 0 1 1989 JUV F HE
0 0 0 … 0 0 0 1 1990 JUV F HE

I have 59 occasions, 48 groups (I did not mention here all my variables), 3 events (Not seen, Seen alive, Seen dead) and 3 states (Alive, Recently Dead, Definitely Dead). I have approximately 28 000 ringed individuals with more than 2 000 recoveries.

This is my shortcuts:

6
Bage g(1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47,2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48)
Sex [g(1 5 9 13 17 21 25 29 33 37 41 45 2 6 10 14 18 22 26 30 34 38 42 46,3 7 11 15 19 23 27 31 35 39 43 47 4 8 12 16 20 24 28 32 36 40 44 48)]
Site g(1 17 33 2 18 34 3 19 35 4 20 36,5 21 37 6 22 38 7 23 39 8 24 40,9 25 41 10 26 42 11 27 43 12 28 44,13 29 45 14 30 46 15 31 47 16 32 48)
period [t(1 2 3 4,5 6 7,8 9 10,11 12 13,14 15 16,17 18 19,20 21 22,23 24 25,26 27 28,29 30 31,32 33 34,35 36 37,38 39 40,41 42 43,44 45 46,47 48 49,50 51 52,53 54 55,56 57 58)]
young [Bage(2).a(1)]
ad [Bage(1)&Bage(2).a(2)]


However, I have always an error when I try to run my model:

In GEMACO:
i --> to
S --> [[young + ad].period.Sex] + random(Site)
E --> firste + nexte.[f(1) + f(2).period]

This is my error message (the same than Wisc88 noted above):

" Error in modme/F1_age_evt_al (line 32)
Error in modme/f_age_al (line 20)
Error in menumuse>Run_Callback (line 1775)
Error in gui_mainfcn (line 95)
Error in menumuse (line 46)
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)menumuse('Run_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback "


I have also the same error using in GEMACO : S --> i + random(Site) or with i + r(Site)

Have you ever dealt with this error message? Do you know what is wrong with my syntax?

I also read Choquet & Gimenez 2011 “Towards built-in capture-recapture mixed models in Programe E-SURGE” and Gimenez & Choquet 2010 “Individual heterogeneity in studies on marked animals using numerical integration: capture-recapture mixed models” without find a solution to my problem.

Thanks a lot for your help,
Benjamin
bfol
 
Posts: 7
Joined: Wed Jul 20, 2016 8:08 am

Re: what is the correct syntax for random effects in E-SURGE

Postby CHOQUET » Thu Jan 25, 2018 9:45 am

Hello,

the more recent paper on the subject is:

Choquet et al. (2013) Estimating demographic parameters from capture–recapture data with dependence among individuals within clusters. Methods in Ecology and Evolution , 4, 474–482 doi: 10.1111/2041-210X.12030

Loading the data set, take care that your object of interest (Plot) is selected as a cluster.
Normally, the syntax i+Plot should work.

Rémi
CHOQUET
 
Posts: 211
Joined: Thu Nov 24, 2005 4:58 am
Location: CEFE, Montpellier, FRANCE.


Return to analysis help

Who is online

Users browsing this forum: No registered users and 16 guests

cron